Tibin Varghese
Tibin Varghese

Reputation: 125

what is vm option in netbeansproject properties?

what is vm option in Netbeans ? what is the meaning of each variable and memmory size of following line

-Xms128m -Xmx128m -XX:PermSize=64m -XX:MaxPermSize=128m

I got this line from stack-overflow troubling with permgen-space

any idea?

Upvotes: 4

Views: 4371

Answers (3)

Ye Win
Ye Win

Reputation: 2098

-Xms128m -Xmx128m -XX:PermSize=64m -XX:MaxPermSize=128m

Above your command is simply ignore the default VM(Vritual Machine) settings and overwrite your customize memory settings to netbeans.

The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool.

This means that your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory. For example, starting a JVM like below will start it with 256MB of memory, and will allow the process to use up to 2048MB of memory:

java -Xmx2048m -Xms256m

The memory flag can also be specified in multiple sizes, such as kilobytes, megabytes, and so on.

-Xmx1024k
-Xmx512m
-Xmx8g

The Xms flag has no default value, and Xmx typically has a default value of 256MB. A common use for these flags is when you encounter a java.lang.OutOfMemoryError.

JVM PermGen

Sun JVM’s has a concept of PermGen space that is a seperate allocated memory region that is used for e.g. allocating classes. This is actually the memory region most people have issues with and not so much the normal heap space, but as a normal user one have a hard time realizing this when eclipse (or rather the jvm) just says “Out of Memory” or simply just crashes.

The solution for this is to add a MaxPermSize value to the vmargs. e.g. I normally use -XX:MaxPermSize=128m to make sure I don’t run out of PermGen space.

Upvotes: 0

user_vs
user_vs

Reputation: 1033

please go through this , hope this help you http://javaeesupportpatterns.blogspot.in/2011/08/java-heap-space-hotspot-vm.html

Upvotes: 0

Ankur Singhal
Ankur Singhal

Reputation: 26067

The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool.

This means that your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.

The Xms flag has no default value, and Xmx typically has a default value of 256MB.

more information here

-XX:PermSize -XX:MaxPermSize are used to set size for Permanent Generation.

Permanent Generation: The Permanent Generation is where class files are kept. These are the result of compiled classes and jsp pages. If this space is full, it triggers a Full Garbage Collection. If the Full Garbage Collection cannot clean out old unreferenced classes and there is no room left to expand the Permanent Space, an Out‐of‐ Memory error (OOME) is thrown and the JVM will crash.

More information here

Starting with Java 8, both the permgen space and this setting are gone.

For netbeans options, have a look here and here

Upvotes: 4

Related Questions