Hi can jhat give me stack trace of where object was allocated? I have
many instance of large object and I need to know where they were
allocated.
I don't know about "jhat".
For what you want, you need a heap profiler. Sun's Java has a simple
heap profiler built-in. Call your application by
(for Java 1.6 or 1.5)
java -agentlib:hprof=heap=sites ....
or (for Java 1.5 or 1.4)
java -Xrunhprof:heap=sites ....
When your applcation ends, Java writes a file "java.hprof.txt". It
contains the stack traces from where the most objects have been
allocated, ordered by heaviness.
For more information call
(for Java 1.6 and 1.5)
java -agentlib:hprof=help
or (for Java 1.5 and 1.4)
java -Xrunhprof:help
Also read the file <yourJDKdirectory>/jre/lib/jvm.hprof.txt