• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

memory calculation

 
Asif Masood
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how the memory required by an object to execute can be calculted?
thanx
 
Avin Sinanan
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you be more specific please... give an example and maybe I an help you... thanks
 
Asif Masood
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to know the memory required by an object to execute. Actually based on this memory, I have to calculate the number of threads (of the Object) that can be allowed to an application.
I think this time it would be more clear.
Thanks
 
Asif Masood
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Avin & Sean,
Can you help me pls regarding above problem.
Thanks
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is not really an easy thing to arrive at. A Vector is an object, but it's size can change during execution. In addition many object have fields that point at OTHER objects, some of which may have been created during the constructor of this object and some not. Then you have to handle the static stuff. This is memory used - but not per object, however - like Vectors etc - it can grow.
To sum all that up - I have not a clue.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For those who are interested, ther is an interesting reading at the following link on that subject:
http://java.sun.com/docs/books/performance/1st_edition/html/JPRAMFootprint.fm.html#243 68
HIH
------------------
Valentin Crettaz
Sun Certified Programmer for Java 2 Platform
 
Asif Masood
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Valentin Crettaz,
Many thanx for the help. This seems very useful as the technique stated in the book, gives a very close estimate of the memory consumption and I think this ll help me to solve the problem as well.
Thanx again.
Asif Masood
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic