This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Performance and the fly likes Tool to view Heap Memory in real time Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Performance
Reply Bookmark "Tool to view Heap Memory in real time" Watch "Tool to view Heap Memory in real time" New topic
Author

Tool to view Heap Memory in real time

Vijaykumar Ramalingam
Greenhorn

Joined: Mar 03, 2011
Posts: 14
Hello All,
I need help to view heap memory in real time and Visualize Garbage Collection as it happens when I create 1million objects.
For the following program below
I want to view analyze how the memory is occupied in the Heap
class Bank{
int balance;
String details;
main(){
Bank b;
for(int i=0 ; i< 1million; i++){
b = new Bank();
}
}
Thanks,
-Vijay

fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 10040
    
    6

To what purpose?

I am not an expert, but this seems like a waste of time. One of the major benefits of java is that you don't have to worry about memory management. And, you can't even be sure the GC will run with this (or any) program.

And further, you don't know it will be the same from run to run, so seeing how it works once is no guarantee that it will be anything similar the next time.


Never ascribe to malice that which can be adequately explained by stupidity.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35438
    
    9
VisualVM is a great tool for that. Its VisualGC (or something like that) plugin shows a lot of interesting graphs.


Android appsImageJ pluginsJava web charts
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tool to view Heap Memory in real time
 
Similar Threads
Confusion on Garbage Collection and Memory Consumption
Help me
View the java heap at Runtime
about abstract class
interface reference variable