Improve Memory Utilization in Java

Tips

  1. Do not allocate excessive memory. Allocate memory only just as much needed. This is specially applicable to Java arrays.
  2. Don’t hold on to references. Once the object is used and no longer needed, assign null reference to it.
  3. Find and resolve memory leaks
  4. Do system profiling on each release to verify memory bumps
  5. Do not rely on System.gc() to run garbage collection

Leave a Comment