Questions tagged [jvm-arguments]

Command-line options and environment variables that can affect the performance characteristics of the Java Virtual Machine

There are several categories of JVM arguments:

  1. Standard options recognized by the Java application launcher (e.g. -client, -classpath, ...)
  2. Options that begin with -X which are non-standard (not guaranteed to be supported on all VM implementations) and are subject to change without notice in subsequent releases of the JDK (e.g. -Xbootclasspath, -Xms, -Xloggc, ...)
  3. Options that are specified with -XX are not stable and are subject to change without notice (e.g. -XX:+PrintGCDetails, -XX:-UseParallelGC, ...)

References:

703 questions
360
votes
13 answers

How to increase IDE memory limit in IntelliJ IDEA on Mac?

I'm using IDEA 12 Leda on Mountain Lion. I wanted to increase the maximum memory that IDE can use. I set the VMOptions in Info.plist file to be -Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar When I open…
woodings
  • 7,503
  • 5
  • 34
  • 52
302
votes
3 answers

What does -XX:MaxPermSize do?

Specifically, why would it help to fix a PermGen OutOfMemoryError issue? Also, bonus points for an answer that points me to the documentation on JVM arguments...
Zefira
  • 4,329
  • 3
  • 25
  • 31
241
votes
3 answers

Difference between _JAVA_OPTIONS, JAVA_TOOL_OPTIONS and JAVA_OPTS

I thought it would be great to have a comparison between _JAVA_OPTIONS and JAVA_TOOL_OPTIONS. I have been searching a bit for one, but I cannot find anything, so I hope we can find the knowledge here on Stackoverflow. JAVA_OPTS is included for…
Tobber
  • 7,211
  • 8
  • 33
  • 56
193
votes
5 answers

How to get VM arguments from inside of Java application?

I need to check if some option that can be passed to JVM is explicitly set or has its default value. To be more specific: I need to create one specific thread with higher native stack size than the default one, but in case the user wants to take…
okutane
  • 13,754
  • 10
  • 59
  • 67
187
votes
3 answers

What does JVM flag CMSClassUnloadingEnabled actually do?

I cannot for the life of me find a definition of what the Java VM flag CMSClassUnloadingEnabled actually does, other than some very fuzzy high-level definitions such as "gets rid of your PermGen problems" (which it doesn't, btw). I have looked on…
Rich
  • 15,602
  • 15
  • 79
  • 126
133
votes
5 answers

How to give Jenkins more heap space when it´s started as a service under Windows?

I want to increase the available heap space for Jenkins. But as it is installed as a service I don´t know how to do it.
Deleted
  • 4,067
  • 6
  • 33
  • 51
104
votes
16 answers

“Error occurred during initialization of VM; Could not reserve enough space for object heap” using -Xmx3G

First of all, I have a box with 8gb of ram, so I doubt total memory is the issue. This application is running fine on machines with 6gb or less. I am trying to reserve 3GB of space using -Xmx3G under "VM Arguments" in Run Configurations in…
user1212731
  • 1,041
  • 2
  • 7
  • 3
101
votes
5 answers

Debug a java application without starting the JVM with debug arguments

Normally to attach a debuger to a running jvm you would need start the jvm with arguments such as the following: > java -Xdebug -Xrunjdwp:transport=dt_socket,address=1000,server=y,suspend=n Now if I want to debug a process that wasn't started in…
hhafez
  • 38,949
  • 39
  • 113
  • 143
98
votes
7 answers

Duplicated Java runtime options : what is the order of preference?

Considering the following command line java -Xms128m -Xms256m myapp.jar Which settings will apply for JVM Minimum memory (Xms option) : 128m or 256m ?
fabien7474
  • 16,300
  • 22
  • 96
  • 124
97
votes
7 answers

Increasing the JVM maximum heap size for memory intensive applications

I need to run a Java memory intensive application that uses more than 2GB, but I am having problems to increase the heap maximum size. So far, I have tried the following approaches: Setting the -Xmx parameter, e.g. -Xmx3000m. This approaches fails…
Alceu Costa
  • 9,733
  • 19
  • 65
  • 83
96
votes
5 answers

Difference between -XX:+UseParallelGC and -XX:+UseParNewGC

They are algorithms for the young generation garbage collection. The second one (UseParNewGC) gets activated automatically with the concurrent tenured generation garbage collection (see Java Concurrent and Parallel GC) but, is there a difference…
fglez
  • 8,422
  • 4
  • 47
  • 78
69
votes
1 answer

CMSPermGenSweepingEnabled vs CMSClassUnloadingEnabled

I've kind of asked this question before - What does JVM flag CMSClassUnloadingEnabled actually do?, but this time it's slightly different! If I start a Java VM with the -XX:+CMSPermGenSweepingEnabled flag set, the following message is…
Rich
  • 15,602
  • 15
  • 79
  • 126
67
votes
3 answers

What does -Xmn jvm option stands for

I tried searching the internet about -Xmn option, without success. Can someone please explain what this stands for and how can I use it to tune JVM?
Bhushan
  • 2,256
  • 3
  • 22
  • 28
67
votes
6 answers

JVM heap parameters

After reading already asked question on the subject and a lot of googling I am still not able to have a clear view of -Xms option My question is: what's the difference between java -Xms=512m -Xmx=512m and java -Xms=64m -Xmx=512m? For now I have the…
Manuel Selva
  • 18,554
  • 22
  • 89
  • 134
67
votes
8 answers

Speed tradeoff of Java's -Xms and -Xmx options

Given these two commands A: $ java -Xms10G -Xmx10G myjavacode input.txt B: $ java -Xms5G -Xmx5G myjavacode input.txt I have two questions: Since command A reserves more memory with its parameters, will A run faster than B? How do -Xmx and -Xms…
neversaint
  • 60,904
  • 137
  • 310
  • 477
1
2 3
46 47