This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Java in General and the fly likes Tool wanted Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Tool wanted" Watch "Tool wanted" New topic
Author

Tool wanted

Sam Samson
Ranch Hand

Joined: Oct 08, 2011
Posts: 61

Hi

Does there exist a tool with that I can see how many objects are actually on the heap etc.?
I'm not sure, but I think VisualVM is not the right tool for that?
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

You're looking for a profiler, such as JProfiler, JProbe, OptimizeIt, or the jvisualvm app that comes with the JDK download.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Sam Samson wrote:
I'm not sure, but I think VisualVM is not the right tool for that?


Why do you think that? Have you tried it, or read about it?
Sam Samson
Ranch Hand

Joined: Oct 08, 2011
Posts: 61

VisualVM is a profiler too, isn't it? But I can't see an option which show me the actual created objects on the heap, and which are eligible for the garbage collector.
Jeff Verdegan
Bartender

Joined: Jan 03, 2004
Posts: 6109
    
    6

Sam Samson wrote:VisualVM is a profiler too, isn't it?


Yes.

But I can't see an option which show me the actual created objects on the heap, and which are eligible for the garbage collector.


Application menu --> Heap Dump will show the instances. I'm not sure off the top of my head how to find which ones are GC-eligible or if that feature is even there. Feel free to read the docs, play around with it, google for tips, and try out the free versions of the others I mentioned.
Sam Samson
Ranch Hand

Joined: Oct 08, 2011
Posts: 61

I'm testing it with VisualVM at the moment, but I'm not able to profile my main method. A workaround is to put it to sleep with Thread.sleep(1000000) , so I'm able to profile it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tool wanted