Software needs memory (RAM) to run. Unfortunately memory is limited. This simply means this: Your application must manage the memory usage effectively or it will suffer.
In a Java application, much of the memory management – scratch that – all of memory management is handled by JVM itself. This is great news for the developers as they don’t need to meddle with ‘malloc’,’free’ and the like. However, due to the fact that every application is different, the out- of-the box JVM memory management may not be efficient.
Garbage Collector is the key element in JVM memory management. In order for your application to run at its maximum speed and reliability, Garbage Collector a.k.a GC must be tuned. GC tuning can be a very time consuming process, mainly because,
1. There are plethora of GC tuning options
2. It takes rigorous testing to identify the effectiveness of the tuning
In the following segments, I will explain how Garbage collector works, the various memory related issues that you might face and how to troubleshoot them. I will also show you few handy tools you can use to speed up troubleshooting.