To control return of heap to the OS, from Java 5 onward, use the -XX:MaxHeapFreeRatio
option, as described in the tuning guide.
If you feel your question is meaningfully different from this one, please point out how.
More Related Contents:
- How ‘random’ is allocation of memory when I say “new Integer” in Java?
- What are the -Xms and -Xmx parameters when starting JVM?
- Memory address of variables in Java
- Shared Memory between two JVMs
- Size of Huge Objects directly allocated to Old Generation
- How to calculate HashMap memory usage in Java?
- What is the default maximum heap size for Sun’s JVM from Java SE 6?
- Where does the JVM store primitive variables?
- Why a sawtooth shaped graph?
- Java Memory explained (SUN JVM)
- Trick behind JVM’s compressed Oops
- PermGen elimination in JDK 8
- Android Studio Gradle project “Unable to start the daemon process /initialization of VM”
- Can Java 8 code be compiled to run on Java 7 JVM?
- Java heap terminology: young, old and permanent generations?
- Difference between _JAVA_OPTIONS, JAVA_TOOL_OPTIONS and JAVA_OPTS
- Debug a java application without starting the JVM with debug arguments
- java.lang.OutOfMemoryError: PermGen space [closed]
- Find out what JVM Eclipse is running on
- Does variable = null set it for garbage collection
- Java Exceptions counter on JVM HotSpot
- Is there one JVM per Java application?
- Read Java JVM startup parameters (eg -Xmx)
- Java verbose class loading
- Java Runtime.getRuntime().exec() alternatives
- If I compiled a Java file with the newest JDK, would an older JVM be able to run the .class files?
- Java for-loop optimization
- Is it good to set the max and min JVM heap size the same?
- Which real-time (RTSJ) JVM is most preferred? [closed]
- Measuring time spent on GC