devexperts / aprof

Java memory allocation profiler
https://code.devexperts.com/display/AProf/
GNU General Public License v3.0
219 stars 39 forks source link

#1 top location is <unknown> #8

Open an-bel opened 7 years ago

an-bel commented 7 years ago

1 top location in my report is unknown, is there anything I can do to make it known? Since that's the #1 location I am pretty curious!

Top allocated data types with reverse location traces

char[]: 50,218,419,736 (40.15%) bytes in 415,001,837 (25.24%) objects (avg size 121 bytes) java.util.Arrays.copyOf: 27,501,437,280 (21.98%) bytes in 190,261,033 (11.57%) objects (avg size 145 bytes) java.lang.StringBuilder.append: 24,752,865,056 (19.79%) bytes in 179,664,087 (10.92%) objects (avg size 138 bytes) unknown: 23,312,893,248 (18.64%) bytes in 176,612,875 (10.74%) objects (avg size 132 bytes)

tsitelov commented 7 years ago

Hi! Could you provide more data, please? What kind of program did you analyze? Maybe you have a guess what kind of code did these allocations? Can you reproduce the problem on some publicly available code?

elizarov commented 7 years ago

It is hard to tell this kind of problem "by picture", but my own experience is that "unknown" locations are usually result from static calls that point to one class in invoker's bytecode, but get actually resolved to its superclass in run time. This can happen in java when your code is compiled against one version of some library, but is run against another version that had moved the correspoinding static method up its method hierarhy. You'll need to explicity add the corresponding method to the list of tracked ones. Figuring this out is usually non-trivial though.