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
62
votes
8 answers

Java stack overflow error - how to increase the stack size in Eclipse?

I am running a program that I've written in Java in Eclipse. The program has a very deep level of recursion for very large inputs. For smaller inputs the program runs fine however when large inputs are given, I get the following error: Exception in…
tree-hacker
  • 5,351
  • 9
  • 38
  • 39
60
votes
4 answers

How to set JVM arguments in IntelliJ IDEA?

I am confused about the instruction when using Kinesis Video Stream Run DemoAppMain.java in ./src/main/demo with JVM arguments set to -Daws.accessKeyId={YourAwsAccessKey} -Daws.secretKey={YourAwsSecretKey}…
Feihua Fang
  • 931
  • 1
  • 8
  • 15
59
votes
3 answers

Running java with JAVA_OPTS env variable has no effect

In a shell script, I have set the JAVA_OPTS environment variable (to enable remote debugging and increase memory), and then I execute the jar file as follows: export JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n…
Ashika Umanga Umagiliya
  • 8,988
  • 28
  • 102
  • 185
54
votes
7 answers

How to give more memory to IntelliJ Idea 9-11

This concerns Intellij from 9 to 11. In the IDEA window On the bottom right corner I see the current memory usage, typically "224M of 254M" How do I give more memory to Idea so it may read like "224M of 512M" ? Thank you.
VijayKumar
  • 613
  • 1
  • 5
  • 8
51
votes
5 answers

increase the java heap size permanently?

Is there a way that I can set the default heap size for the jvm on my own computer? I want to set it to 1g, because I'm always running custom programs that always hit the overage point in the default jvm size. I just dont want to have to remember…
rufus
51
votes
3 answers

How can I disable IPv6 stack use for IPv4 IPs on JRE?

As you can see on below screenshots, eclipse and Android SDK Manager (and other Java programs) are trying to connect to a IPv4 Internet IP via IPv6 TCP/IP stack while Proxifier (a proxy manager program, nevermind) can not support that. How I can…
Ebrahim Byagowi
  • 10,338
  • 4
  • 70
  • 81
50
votes
1 answer

Default values for Xmx, Xms, MaxPermSize on non-server-class machines

What are the default values for the following options in Java 6 on a non-server-class machine? -Xmx -XX:MaxPermSize Oracle's documentation states that: On server-class machines running the server VM, the garbage collector (GC) has changed from…
Rich
  • 15,602
  • 15
  • 79
  • 126
47
votes
4 answers

What is the benefit of setting java.awt.headless=true?

I have gone through Setting java.awt.headless=true programmatically http://www.oracle.com/technetwork/articles/javase/headless-136834.html and Some other links too. Nowhere it is explained the benefit of using this flag. Is it a performance…
user2250246
  • 3,807
  • 5
  • 43
  • 71
43
votes
2 answers

What is the difference between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS when using Java 11?

What is the exact difference between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS when using Java 11? I'm using a tiny test program: public class Foo { public static final void main(String[] args) { System.out.println("arg: " +…
neu242
  • 15,796
  • 20
  • 79
  • 114
43
votes
3 answers

Default for XX:MaxDirectMemorySize

What is the default value for XX:MaxDirectMemorySize?
Timur Fanshteyn
  • 2,266
  • 2
  • 23
  • 27
43
votes
1 answer

How to set a java system property so that it is effective whenever I start JVM without adding it to the command line arguments

There was a change in Java 1.7 in the way the default Locale is get from the OS. There are methods of restoring the old behaviour e.g. by setting the flag -Dsun.locale.formatasdefault=true when starting a JVM instance. I would like to set this flag…
Bug Pecker
  • 433
  • 1
  • 4
  • 6
39
votes
2 answers

Multiple directories in -Djava.library.path

How can I point to two differents java.library.path in eclipse project - run configurations? I need these two libraries: -Djava.library.path=/opt/hdf-java/build/bin -Djava.library.path=/opt/opencv-2.4.10/build/lib Regards.
user4888784
36
votes
5 answers

How do I add default JVM arguments with Gradle

I need to add default JVM options to my jar, when build with Gradle. From the documentation I got that I have to set: applicationDefaultJvmArgs = ["-Djavafx.embed.singleThread=true"] I have not much experience with Gradle and the developer that…
Jhonny007
  • 1,698
  • 1
  • 13
  • 33
34
votes
6 answers

What is the largest possible heap size with a 64-bit JVM?

The theoretical maximum heap value that can be set with -Xmx in a 32-bit system is of course 2^32 bytes, but typically (see: Understanding max JVM heap size - 32bit vs 64bit) one cannot use all 4GB. For a 64-bit JVM running in a 64-bit OS on a…
Michael McGowan
  • 6,528
  • 8
  • 42
  • 70
34
votes
7 answers

Cassandra and Java 9 - ThreadPriorityPolicy=42 is outside the allowed range

Very recently I installed JDK 9 and Apache Cassandra from the official site. But now when I start cassandra in foreground, I get this message: apache-cassandra-3.11.1/bin$ ./cassandra -f [0.000s][warning][gc] -Xloggc is deprecated. Will use…
Martin Matak
  • 351
  • 1
  • 3
  • 8
1
2
3
46 47