A customer is complaining that he’s experiencing a memory leak in our Java application.
Despite all my efforts to reproduce his environment, configuration and usage, I wasn’t able to reproduce, and thus identify, the leak.
I’d want to go down another path… Instead of trying to replicate it, maybe I could ask him to generate some view of his heap that would allow me to identify the leak.
Being run by the customer who would send it to me, there are some requirements on this:
- Should not contain confidential info
- Should be small enough that it can be sent through the internet
- Should be generated by an easily available tool (would be best if it was in the Java distribution)
A complete heap dump is impossible because of 1. and 2.
Most of all, it should allow me to find the leak. So it should at least show the retained heap size for objects of each class (size of itself + everything it keeps a reference to).
jmap -histo is definitely not good enough.
num #instances #bytes class name
----------------------------------------------
1: 14156 577318512 [B
2: 9196 47439696 [I
3: 83396 9809992 [C
Is something like that useful at all? I don’t think so.
Is the customer allowed to do a memory dump himself without sending it to you?
If that is possible, the Eclipse Memory Analyzer has a really easy to use wizard which will generate a leak suspect report. The report itself is very small.