Question

I used jprofiler to detect memory leak for my client code.At starting the memory used by java.util.hashmap$entry was increasing drastically up to 1700KB. after that it decreased too. The Heap dump show java.lang.ref.finalizer was using maximum of memory. What doest it conclude? When i try to find finalize() in my source code it was not there. in HTML file finalize() was used like this. finalize, what does it mean? The cause is finalize() or the reference hashmap$entry is causing the leak?

Was it helpful?

Solution

If you want to look for a memory leak, you should look at how much memory is used after a Full GC, twice if you have lots of finalisable references, otherwise you are likely to see lots of temporary objects which don't matter.

I suspect neither of the data types you are seeing are a problem esp if they go down in usage periodically. Look for consumption which only goes up.

OTHER TIPS

What does it conclude?

First, your so-called "evidence" is garbled, and it is not clear what the ungarbled version should be. However, based on some guesswork ... I can see no clear signs of a memory leak at all.

Rather, it looks like what would happen if you had a large WeakHashMap that either became unreachable, or that got cleared out because the GC noticed that the heap was getting too full.

However, my guesswork could be wrong, and there could be a leak here ...

The cause is finalize() or the reference hashmap$entry is causing the leak?

Not necessarily either. (In fact, if there is really a storage leak at all, it is unlikely that either of those is the direct cause.)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top