[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Confusing array garbage collection, how to get valid heap snapshot?

Yukihiro Matsumoto

5/23/2007 2:01:00 AM

Hi,

In message "Re: Confusing array garbage collection, how to get valid heap snapshot?"
on Wed, 23 May 2007 09:40:04 +0900, Greg Fodor <gfodor@gmail.com> writes:

|Shows that the 1000 objects in the array are still on the heap in the
|second snapshot. Now, I realize GC.start makes no guarantees about
|actually removing the objects marked, but it seems that in this case
|they should go away since I am calling it so aggressively over such a
|long period. What is really strange however is that if I all a.clear
|before setting a to nil, the objects *do* go away upon the first
|GC.start. So, either there is something still holding those references
|in the above case, or the GC is extraordinarily conservative in
|relation to GC.start.

It sometimes happens. I am afraid the array address is pointed from
somewhere in the machine stack.

matz.

1 Answer

Greg Fodor

5/23/2007 2:50:00 AM

0

On May 22, 7:00 pm, Yukihiro Matsumoto <m...@ruby-lang.org> wrote:
>
> It sometimes happens. I am afraid the array address is pointed from
> somewhere in the machine stack.
>
> matz.

Ah. Could I get some pointers in the source to look to better
understand this dynamic? (How and why this stack is retained
within ruby after the return of the ruby method?)

-Greg