From: "nicholasmabry@..." Date: 2008-06-19T11:18:48+09:00 Subject: Re: Can I find out the memory used by an object? On Jun 18, 4:23 pm, Marc Heiler wrote: > What about really simple objects? I agree with the previous responses. The overriding concern with this last question seems to be an examination of why you intend cache the objects. In the case of simple objects, rebuilding objects after the garbage collector frees them is likely not going to cause a bottleneck. For large, complex objects/structures as described in the original post, defining their logical memory size is a problem encountered in all languages where references/pointers are available. It seems the only generally useful solution to unbounded memory growth is to attempt to instantiate an object, and if the platform or OS won't allocate enough memory for it, attempt to free some space and try again. For an interesting discussion of how Ruby's garbage collector can assist with this problem, check out this link: http://whytheluckystiff.net/articles/theFullyUpturnedBin.html -Nick