i take it back, my problems still occur even if i call rb_gc directly from
some native method i write, --- i'll investigate if this is my fault instead
of ruby's

cheers

-----Original Message-----
From: Gaffer [mailto:gaffer / gaffer.org]
Sent: Sunday, May 18, 2003 10:10 PM
To: ruby-talk ML
Subject: Re: ruby garbage collection


strange, i found the rb_gc call on my own and called that to good effect
(after a nasty false start with rb_gc_force_recycle exported on one of my
objects)

it seems to work, where calling GC.start from ruby still has the slowdown
for about 10secs, as if some background processing is going on

cant really explain what i'm experiencing then, if rb_gc_start just calls
rb_gc directly :(

cheers

-----Original Message-----
From: Mauricio Fernandez [mailto:batsman.geo / yahoo.com]
Sent: Sunday, May 18, 2003 9:57 PM
To: ruby-talk ML
Subject: Re: ruby garbage collection


On Sun, May 18, 2003 at 08:35:11PM +0900, Gaffer wrote:
> i need this for a realtime game application which has embedded ruby --
after
> destroying all objects in my scene and recreating everything, ruby gc
takes
> about 10seconds to 'think it through' and collect all garbage... during
> which time the framerate drops in half
>
> i'd much rather it was all done in one hit in between levels, but i cannot
> find an API to do this, and GC.start seems async
>
> so,
>
> assuming GC.start is asynchronous, is there a way to force mark/sweep GC
to
> occur, blocking for however long it takes to complete?

AFAIK GC.start forces GC to take place right away:
gc.c

...

rb_define_singleton_method(rb_mGC, "start", rb_gc_start, 0);

...

VALUE
rb_gc_start()
{
    rb_gc();

...
void
rb_gc()
{

[marks stuff]

     gc_sweep();
}

--
 _           _
| |__   __ _| |_ ___ _ __ ___   __ _ _ __
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com

<sel> need help: my first packet to my provider gets lost :-(
<netgod> sel:  dont send the first one, start with #2
* netgod is kidding