The most important tuning for the Java Virtual Machine (JVM) is the size of the heap memory, which ensures adequate memory is available to manage garbage collection and optimize overall performance.
If the demands require more memory than what is currently available, the JVM must grow the heap, if it can, or perform garbage collection to provide memory to allocate. Resizing the heap and garbage collecting can be an expensive processes and negatively impact performance. Sizing the heap to ensure an adequate amount of memory is available but still manageable to garbage collection is important to optimize overall performance.
PingFederate attempts to optimize JVM heap and garbage collector settings at the time of installation and upgrade. Regardless of available memory, PingFederate uses the Garbage-First (G1) garbage collector (GC). These settings assume PingFederate will be the only service on the server and consume a majority of the memory. Depending on your environment, you can override these settings at a later time.
The JVM can grow the heap from the minimum heap variable value up to the maximum heap variable value. However, growing the heap is often an expensive exercise and requests memory from the operating system. In addition, the JVM must also reorganize the heap to account for the memory being added. To conserve memory in your deployment, set a lower value for the minimum heap than that of the maximum heap to ensure you are not reserving unused memory. If you have enough memory that a certain amount is easily earmarked for the PingFederate server, adjust the size of the heap by setting the minimum heap and maximum heap to the same value. This allows the JVM to reserve its entire heap and decrease the amount of resizing that the JVM needs to perform if the amount of memory in use exceeds the value of the minimum heap.