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

Open the Run Configuration for your application (Run/Run Configurations…, then look for the applications entry in ‘Java application’). The arguments tab has a text box Vm arguments, enter -Xss1m (or a bigger parameter for the maximum stack size). The default value is 512 kByte (SUN JDK 1.5 – don’t know if it varies between vendors … Read more

What does -Xmn jvm option stands for

From here: -Xmn : the size of the heap for the young generation Young generation represents all the objects which have a short life of time. Young generation objects are in a specific location into the heap, where the garbage collector will pass often. All new objects are created into the young generation region (called … Read more

JVM heap parameters

The JVM will start with memory useage at the initial heap level. If the maxheap is higher, it will grow to the maxheap size as memory requirements exceed it’s current memory. So, -Xms512m -Xmx512m JVM starts with 512 M, never resizes. -Xms64m -Xmx512m JVM starts with 64M, grows (up to max ceiling of 512) if … Read more

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

After a lot of searching, the best explanation I’ve found is from Java Performance Tuning website in Question of the month: 1.4.1 Garbage collection algorithms, January 29th, 2003 Young generation garbage collection algorithms The (original) copying collector (Enabled by default). When this collector kicks in, all application threads are stopped, and the copying collection proceeds … Read more

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

As always, check your local JVM’s specific implementation but here is a quick way to check from the command line without having to code. > java -version; java -Xmx1G -XX:+PrintFlagsFinal -Xmx2G 2>/dev/null | grep MaxHeapSize java version “1.8.0_25” Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode) uintx MaxHeapSize … Read more

Debug a java application without starting the JVM with debug arguments

You may be able to use jsadebugd (JDK) to attach a debug server to the process (available on Windows with the Debugging Tools for Windows). It is marked as experimental, so you may want to try it out on a test machine first. Usage: jsadebugd <pid> jdb -connect sun.jvm.hotspot.jdi.SADebugServerAttachingConnector:debugServerName=localhost The connector name withe arg can … Read more