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
34
votes
2 answers

Java VM tuning - Xbatch and -Xcomp

I am looking at the JVM configuration options for running Alfresco, mainly this document on the Alfresco Wiki. One of the recommendations is to use the JVM flags -Xcomp and -Xbatch. The justification of this is: If you wish to have Hotspot…
Rich
  • 15,602
  • 15
  • 79
  • 126
33
votes
7 answers

JVM performance tuning for large applications

The default JVM parameters are not optimal for running large applications. Any insights from people who have tuned it on a real application would be helpful. We are running the application on a 32-bit windows machine, where the client JVM is used by…
amit
  • 10,612
  • 11
  • 61
  • 60
33
votes
2 answers

Can I force the JVM to natively compile a given method?

I have a performance-critical method called often when my app starts up. Eventually, it gets JIT-compiled, but not after some noticeable time being run in the interpreter. Is there any way I can tell the JVM that I want this method compiled right…
Jean-Philippe Pellet
  • 59,296
  • 21
  • 173
  • 234
32
votes
2 answers

Java 8 reserves minimum 1G for Metaspace despite (Max)MetaspaceSize

Java 8 reserves 1G for Metaspace just after it starts. It means that minimum metaspace size is 1G. But I set up MetaspaceSize to 300m and MaxMetaspaceSize to 400m. Why Java reserves more then I allow? Java Version $ java -version java version…
Eugene To
  • 1,890
  • 2
  • 19
  • 30
31
votes
4 answers

what's the difference between ParallelGC and ParallelOldGC?

I have some questions about the GC Algorithm: First when we use the parameters such UseSerialGC, UseParallelGC, UseParallelOldGC and so on, we specify a GC Algorithm. Each of them all can do GC in all generation, is it right? For example, if I use…
leo
  • 361
  • 1
  • 5
  • 11
30
votes
3 answers

Java disable dpi-aware not working

I'm trying to run a Java application with -Dsun.java2d.dpiaware=false argument but nothing happens. I expect to have a blurred UI but with normal size of icons and fonts, it seems that this flag does not work. I'm using JDK 1.8.0_45 on Windows…
blow
  • 12,811
  • 24
  • 75
  • 112
30
votes
2 answers

Is JVM ARGS '-Xms1024m -Xmx2048m' still useful in Java 8?

I have a Java 7 application using JVM ARGS: -Xms1024m -Xmx2048m, and it runs pretty well. After I upgrade to Java 8, it runs in error state with Exception: Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded at…
coderz
  • 4,847
  • 11
  • 47
  • 70
30
votes
3 answers

Java Memory Limit -Xmx suffix: upper vs lower case m/M and g/G

It is commonly known that it is possible to limit the Java heap size with -Xmx, where unit is the data amount unit like Gigabyte, Megabyte, etc. I know that -Xmx128M means 128 Mebibytes (= 128 * 1024 * 1024 bytes). But is it true, that…
MinecraftShamrock
  • 3,504
  • 2
  • 25
  • 44
28
votes
2 answers

JVM Options List - still being maintained post Oracle?

Is the JVM Options List still being maintained anywhere? It seems to have disappeared from Oracle's website, but luckily the Wayback Machine has a copy.
Rich
  • 15,602
  • 15
  • 79
  • 126
28
votes
2 answers

Passing JVM arguments to Tomcat when running as a service?

I need to pass a couple of JVM arguments to the JVM which Tomcat is running in so that my application can pick them up. I want to follow the process outlined in this article to pick up environment variables. How would I go about doing…
Omar Kooheji
  • 54,530
  • 68
  • 182
  • 238
28
votes
4 answers

Java will -classpath option add or replace CLASSPATH environment variable

Will the use of -classpath option with java add to or replace the contents of the CLASSPATH environment variable?
Zacky112
  • 8,679
  • 9
  • 34
  • 36
26
votes
4 answers

Which arguments stand for what in JVM memory options?

There a lot of JVM arguments that affect the JVM's memory usage like -Xms, -Xmx, -Xns, -XX:MaxPermSize... What do they do? Are there any more? Which one do I have to increase when I get what error (e.g. OutOfMemoryError, StackOverflowError...)? I…
Francois Bourgeois
  • 3,650
  • 5
  • 30
  • 41
25
votes
1 answer

How to set -Dorg.apache.el.parser.COERCE_TO_ZERO=false programmatically

This question is similar to: jsf: integer property binded to a inputtext in UI is set to zero on submit but I am not completely satisfied with the solution. The contexts is the same: I have a web form requiring an Integer value. If the textbox is…
Steve
  • 11,831
  • 14
  • 51
  • 63
24
votes
3 answers

How to define default JVM arguments in IDEA?

Is there an option to define default JVM arguments in IntelliJ IDEA? For example, I would like to always activate: -ea -Dslf4j.detectLoggerNameMismatch=true In Eclipse, the option can be found in: Preferences -> Java -> Installed JREs -> Edit ->…
Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
22
votes
8 answers

Could not initialize class sun.awt.X11GraphicsEnvironment on Solaris

I am running into this error while running my installer on a Solaris machine: Installing... ------------- [==================|==================|==================|==================] [---Invocation of this Java Application has caused an…
Deka
  • 541
  • 1
  • 3
  • 7
1 2
3
46 47