How to Improve Memory Utilization in Java