Tuning Java/JVMs largely addresses garbage collection (GC) and memory heap size tuning.
With the majority of JVMs, tuning heap size requires understanding how the application is using memory, modifying parameters and re-profiling. The application needs to be running close to production loads as much as possible.
This is not easy to do, since some real-world loads just aren't seen in the lab. Most JVMs deliver the ability to set an initial and maximum heap size, although there are some that also allow other parameters such as large pages. If the heap size is set too big, GC pauses become too long; if heap size is set too small, the application will throw an out-of-memory error and likely crash. Thus garbage collection turning and memory are closely related topics that impact application performance.
For more information about garbage collection and JVM performance tuning, watch this video from Azul's CTO Gil Tene about the different collection and tuning strategies. Java developers can improve reliability, application performance, and scalability by making more informed choices about performance tuning options.