java - sergiocontrino/docs GitHub Wiki

Java

XX:SoftRefLRUPolicyMSPerMB Starting with 1.3.1, softly reachable objects will remain alive for some amount of time after the last time they were referenced. The default value is one second of lifetime per free megabyte in the heap. This value can be adjusted using the -XX:SoftRefLRUPolicyMSPerMB flag, which accepts integer values representing milliseconds. For example, to change the value from one second to 2.5 seconds, use this flag:

-XX:SoftRefLRUPolicyMSPerMB=2500

The Java HotSpot Server VM uses the maximum possible heap size (as set with the -Xmx option) to calculate free space remaining. The Java Hotspot Client VM uses the current heap size to calculate the free space.

This means that the general tendency is for the Server VM to grow the heap rather than flush soft references, and -Xmx therefore has a significant effect on when soft references are garbage collected. On the other hand, the Client VM will have a greater tendency to flush soft references rather than grow the heap.

The behavior described above is true for 1.3.1 through Java SE 6 versions of the Java HotSpot VMs. This behavior is not part of the VM specification, however, and is subject to change in future releases. Likewise the -XX:SoftRefLRUPolicyMSPerMB flag is not guaranteed to be present in any given release.

[ref] (http://www.oracle.com/technetwork/java/hotspotfaq-138619.html)

server Sets the HotSpot JVM type to server (larger default size for heap, parallel garbage collection, optimizes code more agressively at run time). If not specified, the JVM might choose this anyway based on machine type.
XX:MaxPermSize Size of the Permanent Generation. Stores classes, methods, internalized strings, objects used by the VM and never deallocated. Increase if you load many classes. [Default = 96m]
Xmx The maximum Java heap size. [Default for 64 bit Linux = 50% of available physical memory up to 2 GB]
Xms The initial and minimum Java heap size. [Default in server mode = 25% of the amount of free physical memory in the system, up to 64 MB and at least 8 MB]
XX:+UseParallelGC Use parallel garbage collection (multiple threads) for scavenges.
XX:SoftRefLRUPolicyMSPerMB Sets the amount of time (in ms) a softly reachable object (soft reference) remains alive after it was last referenced per Mb of free heap space. [Default = 1 second per free Mb in the heap]
XX:MaxHeapFreeRatio Maximum percentage of heap free after GC to avoid shrinking. [Default = 70]
⚠️ **GitHub.com Fallback** ⚠️