This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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).
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!