Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » TPTP 4.1 Basic Memory Analysis
TPTP 4.1 Basic Memory Analysis [message #49179] Wed, 04 January 2006 21:37 Go to next message
Eclipse UserFriend
Originally posted by: geld1.nexus.hu

Hello,

I'm just playing with TPTP and it seems very usefull to me mainly in the
Execution Time Analysis. But I don't really understund the Memory
area. I made the following class:
public class demo {
public int i1;
public String s1;
}
and made an instance from it as this:

demo d2 = new demo();
d2.i1 = 5;
d2.s1="TextTextTextTextTextTextTextTextTextTextText";

My question is why the Memory Analysis says for the total size 16 byte?
Can I anyhow get the real size of an object?

Thanks!
Re: TPTP 4.1 Basic Memory Analysis [message #49202 is a reply to message #49179] Thu, 05 January 2006 01:32 Go to previous messageGo to next message
Randy D. Smith is currently offline Randy D. SmithFriend
Messages: 394
Registered: July 2009
Senior Member
Why would it say the total size is 16 bytes? I guess because the object
(solely) takes up 16 bytes!*

If you're wondering where the 88 bytes (44 double byte characters) are
accounted for, they show up in my memory analysis pane right below the
16 byte record as tied to "java.lang" (presumably java.lang.String,
specifically).

I guess I'm belaboring the point that you may think that the TextText...
is a part of your object, but it isn't... it's just being referred to by
your object.

Now I can see your point that you might want an accounting of "my
object, and all the things it refers to", but... do you really want
that? At what level of inter-connectedness do we stop saying something's
data is attributable to a given object? After all, in a normal Java
program, *everything* can be tied back to some original instance item,
sometimes even to a single instance item... if it's not tied in in some
way, it's garbage collected and doesn't really exist!

*So why 16 bytes? I wonder that myself. I see 4 bytes for the int, and I
assume 4 bytes for the String reference... are the other 8 for a
reference to the base class (Object) and ... ?? I'm sure someone better
knowledgeable about the inner workings of Java bytecode will enlighten
me, at which point I'll smack myself in the head and say "Of course,
you're right... I should have known!" Hmmm, if someone is so inclined as
to enlighten me, how about explaining where the run-length coding info
on the 44 character string is accounted for; it's sure not doing
null-terminated strings so that info has to be stored somewhere as well
as the actual string contents.
--
RDS


elmu wrote:
> Hello,
>
> I'm just playing with TPTP and it seems very usefull to me mainly in the
> Execution Time Analysis. But I don't really understund the Memory area.
> I made the following class:
> public class demo {
> public int i1;
> public String s1;
> }
> and made an instance from it as this:
>
> demo d2 = new demo();
> d2.i1 = 5;
> d2.s1="TextTextTextTextTextTextTextTextTextTextText";
>
> My question is why the Memory Analysis says for the total size 16 byte?
> Can I anyhow get the real size of an object?
>
> Thanks!
Re: TPTP 4.1 Basic Memory Analysis [message #51263 is a reply to message #49202] Mon, 23 January 2006 16:25 Go to previous message
Eclipse UserFriend
Originally posted by: karl.scheibelhofer.iaik.tugraz.at

hi,

"Randy D. Smith" <randy.d.smith@intel.com> wrote in message
news:dpht08$ssg$1@utils.eclipse.org...
> ...
> Now I can see your point that you might want an accounting of "my object,
> and all the things it refers to", but... do you really want that? At what
> level of inter-connectedness do we stop saying something's data is
> attributable to a given object? After all, in a normal Java program,
> *everything* can be tied back to some original instance item, sometimes
> even to a single instance item... if it's not tied in in some way, it's
> garbage collected and doesn't really exist!
> ...

well, i really cannot agree to "..*everything* can be tied back to some
original instance item..." in general. data objects usually do not refer
back to objects which manage them. that simply does not make sense and it is
not necessary in many (most) cases. there are applications which have a very
static behavior, but there are also many applications which are very
dynamic.

having a feature for determining the complete memory consumption of an
object including all objects it refers to (directly or indirectly) would be
a very useful feature. for example, if you want to calculate how an
application would scale to large environments. with the current version
(4.1), it is hard (or impossible) to find out which objects consume how much
memory in total.
such a feature could even detect loops and handle them. an object which
directly or indirectly references all other objects in a system would be
simply show as consuming the total memory.

Karl
Previous Topic:IBM alphaworks UIMA and Application Log analysis
Next Topic:Automated GUI Recorder capabilities
Goto Forum:
  


Current Time: Fri Mar 29 07:04:15 GMT 2024

Powered by FUDForum. Page generated in 0.02786 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top