質問

Is there a feature like Finding which methods allocated large objects for Sun JAVA?

-Xdump:stack:events=allocation,filter=#1k

or

-Xdump:stack:events=allocation,filter=#2m..4m
役に立ちましたか?

解決 2

Also a native way to do this exists via Java agent: code.google.com/p/java-allocation-instrumenter – Martin Jun 6 '13 at 3:26 see also How to find all referrers of an object in Java?

他のヒント

I'm not sure there is a way to do this with just command lines to the JVM, but you should be able to use hprof to dump the heap, and then analyze the dump using jhat to find the large objects and where they were allocated (assuming they are still in the heap when hprof dumps it).

You can use hprof to dump the heap like so:

java -agentlib:hprof=heap=dump

This will give you a file .hprof, then you can run jhat:

jhat <pid>.hprof

jhat will run a webserver at:

 http://localhost:7000. 

So point your browser there and take al ook.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top