Thursday, August 10, 2017

How to avoid memory leaks in Java?

To avoid such situation in our applications we have to remember


1. We have to close the resources which we opened in our application like files
2. Better to override hashcode() and equals() method while using HashMaps
3. Stop and start the applications ports
4. Better to use diagnostic tools like JConsole to know the memory allocation to the objects

No comments: