jvm-arguments

How can one send a Ctrl-Break to a running Linux process?

断了今生、忘了曾经 提交于 2019-12-05 02:30:24
I am debugging a memory leak in an application running on Sun's JDK 1.4.2_18. It appears that this version supports the command line param -XX:+HeapDumpOnCtrlBreak which supposedly causes the JVM to dump heap when it encounters a control-break. How does one send this to a background process on a Linux box? It appears that kill signals are the way this ought to work, but I kill -l doesn't report anything that is obviously a Ctrl-Break, at least on my Ubuntu box. Update: I tested Kill -3 with Sun JDK 1.4.2_18 (_14 was the first to dump heap this way), and it worked. A heap dump file was created,

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

不想你离开。 提交于 2019-12-05 00:18:51
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 benefit? If yes, is there even a rough quntization how much performance benefit there will be? (I know that answers to performance questions totally depend upon case to case, but it would be nice to know if someone reported a good benefit from doing this). Headless and non-headless modes are different, they have different set of features. If you only need

Dynamically expandable JVM stack

▼魔方 西西 提交于 2019-12-04 15:18:50
The JVM specification indicates the JVM stack can be either fixed size or dynamically expandable. The -Xss JVM option allow to set the fixed size and if I am right not setting this option is setting a default value (around 512-2048k), but how can tell the JVM to dynamically allocate its stack when needed? If I cannot set a dynamical size option, will setting a large -Xss value (let's say 20M) actually allocate 20MB of memory for each thread in my JVM or is it dynamically allocated memory that will be limited to 20MB? The maximum stack size is the amount of virtual address space that gets

Default for XX:MaxDirectMemorySize

筅森魡賤 提交于 2019-12-04 15:12:55
问题 What is the default value for XX:MaxDirectMemorySize? 回答1: From http://www.docjar.com/html/api/sun/misc/VM.java.html i see: 163 // A user-settable upper limit on the maximum amount of allocatable direct 164 // buffer memory. This value may be changed during VM initialization if 165 // "java" is launched with "-XX:MaxDirectMemorySize=<size>". 166 // 167 // The initial value of this field is arbitrary; during JRE initialization 168 // it will be reset to the value specified on the command line,

How to add jvm parameters for a runnable jar?

徘徊边缘 提交于 2019-12-04 09:25:21
For the runnable jar that i am creating. it requires xmx1024 as JVM argument. How can i do this ? Or is there any alternative ? Raffaele You can provide a startup script for each and every platform the program is intended to run on. For example on Linux you can have program.sh java -mx1024 -jar lib/artifact.jar arg1 arg2 Obviously you have to tell the user that the program is intended to be run from the startup script, because if they try to manually start the jar it will fail. You can even check in your program if the VM has been started with the required arguments and fail soon if not. Refer

How can I OOM sooner in excessive GC? [duplicate]

≯℡__Kan透↙ 提交于 2019-12-04 08:19:07
This question already has an answer here: Adjusting GC Overhead Exceeded parameters 1 answer Occasionally my JVM runs out of memory, but rather then OOMing which I can recover from (or heapDumpOnOOM and debug) it tends to thrash in GC for hours before throwing out of memory. This is essentially the same as the (unanswered) question: How can I configure the Java GC Overhead Limit? But I suspect the answer is you can't tune the 98%/2% thresholds, so I'm asking of any way to achieve similar effect. notice excessive GC, and preferably cause OOM, or kill the JVM or such. Oracle's GC ergonomics

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

主宰稳场 提交于 2019-12-04 03:14:33
What is the exact difference between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS when using Java 11? They seem to do the same, but the output is slightly different. That makes me believe they might have different use cases: $ JDK_JAVA_OPTIONS="-Dstuff" java Foo NOTE: Picked up JDK_JAVA_OPTIONS: -Dstuff $ JDK_JAVA_OPTIONS="illegalStuff" java Foo NOTE: Picked up JDK_JAVA_OPTIONS: illegalStuff Error: Cannot specify main class in environment variable JDK_JAVA_OPTIONS $ JAVA_TOOL_OPTIONS="-Dstuff" java Foo Picked up JAVA_TOOL_OPTIONS: -Dstuff $ JAVA_TOOL_OPTIONS="illegalStuff" java Foo Picked up JAVA

What is thread stack size option(-Xss) given to jvm? Why does it have a limit of atleast 68k in a windows pc?

我怕爱的太早我们不能终老 提交于 2019-12-03 20:53:18
I have seen JVM option -Xss - What does it do exactly? this link, but my question is how is this option useful. Because, if we set a very minimum limit to the -Xss value, maybe the threads are not going to work properly as it may throw stackOverflow error most of the times. Why is there a 64k limit at least for this value? How i got this 64k limit is when i was trying to configure the runtime vm options on the IntelliJ iDE, I tried to give some thing like 10k and it popped up this error stating it needs at least 64k for thread stack size. Another question is that, how to find the default

Passing an entire file to JVM arguments

£可爱£侵袭症+ 提交于 2019-12-03 13:31:20
问题 I have several systems that all need to load the same properties to the JVM. I can use the -D flag to load one property at a time, but i am looking for something that will load all the properties in an entire file at one time. For instance: I could just add --options-file=blah.properties to all jvms on my network, once, and from then on only change the properties file, which could be a single central file over a network share. Thank you, EDIT: Any arguments or commands must also work in a

what is the right way to set JVM param's in eclipse

牧云@^-^@ 提交于 2019-12-03 12:53:22
问题 i am using eclipse 4.2 to execute a junit test. the test uses a lot of memory so what i want to do is to enlarge the memory allocated to the jvm. i wanted to know if there is a differences between setting the heap memory param's in the eclipse ini file and the run configuration? 回答1: Note the memory settings for Java processes started by eclipse are different from the maximum allowed memory size for eclipse itself. The allowance for eclipse itself is set on startup by -vmargs -Xmx1024M