File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes memory calculation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "memory calculation" Watch "memory calculation" New topic
Author

memory calculation

Asif Masood
Greenhorn

Joined: Dec 13, 2000
Posts: 20
how the memory required by an object to execute can be calculted?
thanx
Avin Sinanan
Ranch Hand

Joined: Nov 07, 2001
Posts: 109
Could you be more specific please... give an example and maybe I an help you... thanks


yours respectfully<br />Avin Sinanan
Asif Masood
Greenhorn

Joined: Dec 13, 2000
Posts: 20
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

Joined: Dec 13, 2000
Posts: 20
Hi Avin & Sean,
Can you help me pls regarding above problem.
Thanks
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
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.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
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


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Asif Masood
Greenhorn

Joined: Dec 13, 2000
Posts: 20
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: memory calculation
 
Similar Threads
Tag Library and Struts Framework
WA #1.....word association
char doubt
How to pass the values between MIDlets?
Jess in J2ME