-Xverify option in java




In this tutorial we will learn how to use -Xverify option in java. And how to speed up eclipse.

Contents of page >
  • 1) What is purpose of using -Xverify option?
  • 2) Using -Xverify  with different parameters >
    • -Xverify:remote
    • -Xverify:all
    • -Xverify:none
  • 3) What happens if you don’t pass any option to -Xverify ? What is default value of -Xverify ?
  • 4) How -Xverify can speed up eclipse ?
  • 5) Should you use -Xverify:<none> in production environment?


1) What is purpose of using -Xverify option?
-Xverify option manually verifies the correctness of the bytecode at the time when java classes are loaded.
-Xverify option helps us in improving the efficiency of classes at runtime.

2) Using -Xverify  with different parameters >
  • -Xverify:remote - It will Verify only those java classes loaded over network.
  • -Xverify:all - It will verify bytecode of all java classes.
  • -Xverify:none - It will not verify bytecode of any java class.

3) What happens if you don’t pass any option to -Xverify ? What is default value of -Xverify ?
Default value of -Xverify option is remote.
So -Xverify:<remote> will be used at runtime by default.
So, if you don’t pass any option to -Xverify. It will Verify only those those java classes loaded over network.

4) How -Xverify can speed up eclipse ?
As -Xverify:none will not verify bytecode of any java class, it will help in speeding up eclipse.

Example >
E:\>java -Xverify:none MyJavaProgram
This is my first Java Program

E:\>
Learn how to pass vmargs (VM parameters) to java program in eclipse?

5) Should you use -Xverify:<none> in production environment?
No, we must not use -Xverify:<none> in production because in that case bytecode of any class will not be verified and might lead to some serious security issues.
And verification of byte code is very important process in JVM during loading of classes.
Class Loader Subsystem of JVM is used to load class files. Classloader verifies the class file using byte code verifier. Class file will only be loaded if it is valid. So, making any changes to default class loading process is NOT advisable.




Summary -
So in this core java tutorial we learned What is purpose of using -Xverify option? How to use -Xverify  with different parameters. What happens if you don’t pass any option to -Xverify ? What is default value of -Xverify ? How -Xverify can speed up eclipse ? Should you use -Xverify:<none> in production or not?





Having any doubt? or you liked the tutorial! Please comment in below section.
Please express your love by liking JavaMadeSoEasy.com (JMSE) on facebook, following on google+ or Twitter.



RELATED LINKS>

 

Different type of garbage collectors in java>

>Serial collector / Serial GC (Garbage collector) in java

>Throughput GC (Garbage collector) or Parallel collector in java

>Concurrent Mark Sweep (CMS) collector / concurrent low pause garbage collector in java

>G1 garbage collector / Garbage first collector in java


Important VM parameters >

>Most important and frequently used VM (JVM) PARAMETERS with examples in JVM Heap memory in java

>What are -Xms and -Xmx JVM parameters in java, And differences between them with examples


Eclipse and VM parameters >

>What is eclipse.ini file? How to pass vmargs to java program in eclipse? Changing the eclipse setting, What are best eclipse setting?



Monitor, analyze garbage collection and fix MEMORY LEAK >

>How to monitor and analyze the garbage collection in 10 ways in java

>Detecting and fixing memory leak in java

Apache tomcat server,outOfMemory and Garbage collection in java >

>How to set or change permgen size in tomcat server, eclipse?


eEdit
Must read for you :