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.
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
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.