Thread size?

W

wazary

Hi,
I made an object Task which is an extension of
a thread. Is there a way to know what
is the size of my thread object while it's running?
I looked for it into the apidocs, but I only
find methods to know the size for primitive types.
Thanks in advance.

Mattia
 
J

jan V

a thread. Is there a way to know what
is the size of my thread object while it's running?
I looked for it into the apidocs, but I only
find methods to know the size for primitive types.

Object sizes are JVM implementation dependent. Simply adding up the sizes of
all the fields (incl. inherited ones!) will give you a lower bound value.

Can you tell us why you are worried about the size of your Task objects?
Surely you are not going to spawn that many to have any significant impact
on your heap's free size?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top