From: Robert Dober Date: 2008-06-19T06:11:38+09:00 Subject: Re: Can I find out the memory used by an object? On Wed, Jun 18, 2008 at 8:28 AM, Robert Klemme wrote: > On 17.06.2008 19:23, Robert Dober wrote: >> >> On Tue, Jun 17, 2008 at 5:53 PM, Robert Klemme >> wrote: >>> >>> On 17 Jun., 12:42, Marc Heiler wrote: >>>> >>>> Good question :) >>>> >> I think it could be defined, however I do not know if this is useful, >> maybe when considering running on low memeory devices and a >> deterministic garbage collector. > > Exactly what I mean: a simple definition is more often than not useless for > practical purposes but a useful definition is complex and hard to automate > (i.e. if you want to implement a mechanism that reports on used memory). > >> I would define the memory to be used by an object as the number of >> bytes that have been (re)allocated for it and that could be freed by >> the GC if there were no more references to that object. I would not >> care at all if collecting this object >> makes other objects collectable. > > This is pretty much the definition I posted as well. At least this is what > I mean. I like your definition better for its improved technical precision > over mine. > >> This however is where Robert's probably right, if you have to worry >> over memory consumption than you have to pretty >> much sure about releasability of other objects too. > > Exactly. > >> But I disagree humbly with my homonym that the question does not make >> sense at all ;). > > Um, where exactly did I say that? > > Kind regards > > robert > > > PS: Thanks for the "homonym"! Learn something new every day. :-) > > -- http://ruby-smalltalk.blogspot.com/ --- As simple as possible, but not simpler. Albert Einstein