View RSS Feed

Advanced Java

Minimize memory leaks in Java

Rating: 1 votes, 3.00 average.
by , 01-08-2012 at 01:46 PM (2531 Views)
The main causes for memory leaks in java are poor design with invalid references. Garbage collector is not able to claim those objects.

Following steps help you to detect memory leaks in your application.

• Use tools like JProbe, OptimizeIt.
• Use operating system process monitors.
• Override totalMemory() and freeMemory() methods in the Java Runtime class.

Following steps help you to minimize memory leaks in your application.

• Keep in mind object’s life cycle while designing applications.
• Set the root of a collection to null so that garbage collection can collect it.
• Use weak references.

Submit "Minimize memory leaks in Java" to Facebook Submit "Minimize memory leaks in Java" to Digg Submit "Minimize memory leaks in Java" to del.icio.us Submit "Minimize memory leaks in Java" to StumbleUpon Submit "Minimize memory leaks in Java" to Google

Categories
Memory

Comments