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
10
votes
3 answers

passing Jvm properties (via -D) that contain spaces

I have a docker application that runs a java jar inside from the command line. I have set up the docker container to pass through "other java options", and in this case I would like to pass the following: jdk.certpath.disabledAlgorithms=MD2, MD5,…
Kevin Milner
  • 821
  • 2
  • 14
  • 30
10
votes
2 answers

How to catch OutOfMemoryError in JVM and run a script if it's caught?

I have a program that sometimes throw OOME, I understand that there is a flag in the JVM options that I can set and whenever a certain Error/Exception appears (such as OOME) it calls a script I wrote. The script will give the user a notification…
Aye
  • 101
  • 1
  • 3
10
votes
1 answer

How to debug a Java agent

At the moment there is possibility to run JVM with an agent: -javaagent:somejar.jar this way in order to run the Java agent I have wrote as an I have to put it into a jar. therefore it is limited in debugging. Is there a technique for debugging a…
user2850243
10
votes
3 answers

Within a running JVM, how to programmatically determine the jvm options used at startup?

Background: I'm doing some performance testing on a Java application that gets launched through several layers of indirection, such that I'm not entirely sure that the application is getting launched with the flags that I think it is. I'd like my…
Mickalot
  • 2,431
  • 3
  • 22
  • 23
10
votes
1 answer

What is the difference between -HeapDumpOnOutOfMemoryError and +HeapDumpOnOutOfMemoryError options?

In Oracle's official doc HeapDumpOnOutOfMemoryError option specified with plus and minus sign. I'm just curious what do they stand for since it's not explained in official user guide
Petro Semeniuk
  • 6,970
  • 10
  • 42
  • 65
10
votes
1 answer

Cannot create JVM with -XX:+UseLargePages enabled

I have a Java service that currently runs with a 14GB heap. I am keen to try out the -XX:+UseLargePages option to see how this might affect the performance of the system. I have configured the OS as described by Oracle using appropriate shared…
teabot
  • 15,358
  • 11
  • 64
  • 79
9
votes
1 answer

ZGC max heap size exceed physical memory

JVM options is -server -Xmx100g -Xms100g -XX:MaxMetaspaceSize=1G -Xss512k -XX:+UnlockExperimentalVMOptions -XX:+UseZGC -XX:MaxGCPauseMillis=30 -XX:ConcGCThreads=4 -XX:ParallelGCThreads=12 -XX:+DisableExplicitGC…
allen
  • 91
  • 1
  • 2
9
votes
2 answers

Set vm default arguments via maven for eclipse

I want to specify vm args of -Djava.library.path=./src/main/resources so that a dll is picked up automatically, and I want to specify this in maven, so other developers don't have to manually configure eclipse. I was thinking perhaps the the maven…
David Turner
  • 5,014
  • 6
  • 26
  • 27
9
votes
1 answer

Difference between noverify and Xverify:none?

What is the difference between the JVM arguments noverify and Xverify:none?
user2997204
  • 1,344
  • 2
  • 12
  • 24
9
votes
1 answer

How to make JVM release memory back to OS

I am using GC options XX:+UseParNewGC-XX:+UseConcMarkSweepGC for my application. As most of you are already experiencing JVM is good at increasing heap up to max heap size, however it does not release memory back to OS. I came across…
Pushkar
  • 541
  • 4
  • 18
9
votes
2 answers

Can't set memory settings for `sbt start`

I'm trying to run sbt start in a Play Framework application written in Scala, on a machine that is an ec2 t2.micro instance on AWS. But i can't because There is insufficient memory for the Java Runtime Environment to continue. The machine has 1GB of…
Hunor Kovács
  • 1,062
  • 9
  • 16
9
votes
2 answers

Java: How to specify JVM argument -XX:ErrorFile and preserve automatic PID in filename

I am using the JNI and when there is a crash due to errors in the target application a hs_err_pid*.log file is generated. I want to change the default location where that file is stored. Now, from searching around I understand this can be achieved…
edr
  • 436
  • 3
  • 5
  • 15
9
votes
3 answers

Possible values for the "java.compiler" system property

(I know this is probably a duplicate, but is it almost impossible to search this topic on Google or on SO.) I know the java.compiler system property can take "NONE" which disables the JIT compiler, but I am interested in what other values are there…
billc.cn
  • 7,187
  • 3
  • 39
  • 79
8
votes
5 answers

Is there a way to tell which GC algorithm the JVM is currently using

I am using Java 5 and our custom server application needs GC tunning, as some times we are experiencing 15-20 seconds pause on peak hours. We are running Java 5 on a server class machine with JVM args like -server -d64 Is there a way to tell which…
8
votes
1 answer

Programmatically detect --preview Mode in JRE

Since Java 11, a PREVIEW-MODE on the Java Compiler and Runtime can be enabled. It allows to preview new features. (JEP 12) java --enable-preview How can I detect from within Java whether the JVM has been started with preview-mode enabled? The…
alfonx
  • 6,936
  • 2
  • 49
  • 58