Which is the best way to optimize memory in Java?

With all this knowledge at hand it is not difficult to give the general Java memory optimization tips: Prefer primitive types to their Object wrappers. The main cause of wrapper types usage are JDK collections, so consider using one of primitive type collection frameworks like Trove .
For More Information Please Refer:
You May Also Like to Read: