This week's book giveaways are in the Scala and Android forums.
We're giving away four copies each of Machine Learning Systems: Designs that scale and Xamarin in Action: Creating native cross-platform mobile apps and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory calculations...  RSS feed

 
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have to estimate how much mem a particular object is taking at runtime.
I have tried JProfiler,but have found that it is quiet an heavy application in itself.
Is there any freeware which will give me a decent estimation of how much increase/decrease in mem have been caused by the changes made to the code by me?
Thanks,
Chinmay.....
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at JavaWorld's Java Tip 130: Do you know your data size?.
 
Chinmay Bajikar
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dirk,
I have gone thru the article and found it to be informative.
But didnt understand this one statement by Valdimir.....
"I am not sure why, but it's possible creating and destroying a method call-stack frame causes a change in the reachability root set and prompts the garbage collector to work harder."
Can u shed some light on this???
Thanks and regards,
Chinmay..

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is some more <a href="http://www.javapractices.com/Topic83.cjp">example code</a> for this
task. It follows the style of the book "Java Platform Performance", by Wilson and Kesselman.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Chinmay Bajikar:
Hi Dirk,
I have gone thru the article and found it to be informative.
But didnt understand this one statement by Valdimir.....
"I am not sure why, but it's possible creating and destroying a method call-stack frame causes a change in the reachability root set and prompts the garbage collector to work harder."
Can u shed some light on this???


I'm not completely familiar with the details of garbage collection and JVM implementations. I believe that what the author is suggesting is that when a method terminates, this might send a special signal to the garbage collector that it consider running as some objects in memory were possibly just made unreachable (i.e. aren't being used any more).
 
Die Fledermaus does not fear such a tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!