memprof / GC dynamics

3 views
Skip to first unread message

Steven Parkes

unread,
Feb 23, 2010, 6:46:18 PM2/23/10
to ruby...@ruby-lang.org, johnso...@googlegroups.com, dam...@alumni.cmu.edu, Aman Gupta
Wow, memprof is great stuff.

I have a case I don't really understand, though. (On 1.8.7-p249)

I have

<code>
Memprof.start # optionally
GC.start
<code>

Whether I have the Memprof.start call in there or not changes the results of GC.start. [GC.start should be a complete mark/sweep, shouldn't it?]

My context is Johnson, which is linking to Spidermonkey, the Mozilla JS interpreter. Johnson has C ext Ruby objects that are roots to Spidermonkey's GC. If I run GC.start w/o Memprof.start, it appears Ruby refs are getting through the GC and staying roots to Spidermonkey. Simply adding Memprof.start changes this: the GC.start does (apparently) free those roots.

I don't know that this is related to Memprof per-se: just happened to be what I was using. Is this simply stack shadowing, with Memprof dirtying the stack enough that Ruby doesn't see any false references?

I suppose I should try on REE ...

Reply all
Reply to author
Forward
0 new messages