That because VisualVM computed not just the size of that object but the sizes of all of the objects it was holding onto. Shazam! There it is! In this faked up example I built there is a single Stack instance but it’s retained size is huge. Then on the summary page I notice the "Find 20 biggest objects by retained size:". It turns out that the leak is in a class that only has one instance and it is holding onto thousands of objects. I was using VisualVm to monitor the heap so I started poking around to see if there was anything to help diagnose where the leak was.įirst thing I did was to take a heap dump. I thought I had fixed it by performing a evict()/clear()/flush() in the HibernateTemplate that I was using but suddenly the leak was back. At work I had run into a memory leak when scrolling through large result sets returned from Hibernate.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |