3

I have a memory issue. And I found a huge char[] in heap dump. But I don't know where it come from. It is a weak/soft reference. Is there any tool/approach to track this kind of basic type array allocation?

crabhit
  • 139
  • 1
  • 2
  • 7
  • with a jmap heap dump, you can look at the array and see what it says. Maybe that helps. Eclipse MAT is a good tool for digging through this: http://www.eclipse.org/mat/ – Thilo Jul 20 '12 at 07:38

3 Answers3

3

Try VisualVM, it is a very powerful tool! See VisualVM

M. Abbas
  • 6,409
  • 4
  • 33
  • 46
2

Finally I found a good way to tack array allocate. Here is link for example http://kenai.com/projects/btrace/sources/hg/content/samples/NewArray.java?rev=442

crabhit
  • 139
  • 1
  • 2
  • 7
1

For this kind of problem, I think it's to to look into instrumentation and profiling your code. Java has hooks that allow external programs to poke around the heap. I think a great one, which has a free trial, is jprofiler

http://www.ej-technologies.com/products/jprofiler/overview.html

keefe
  • 46
  • 1