>> some code that constructs ruby objects. (I've tried without, and the >> GC >> sweeps my partly constucted objects away). > > Something wrong in your "partly constructing" way. Is there ? I'm reconstructing a possibly cyclic graph of objects from data. And I do it in C, by necessity. As far as I can see that will always leave me with objects that are not referenced from Ruby. > How are you doing it? It is in essence the same as in marshal.c . So there's memory, I check the "type" of it, construct a ruby object accordingly and especially for objects/arrays/hashes do so recursively. I have a place to store a flat list of all objects, so I don't load any twice, but I'd want to keep that in C if possible. I think the same problem would occur in marshal there if you just made a test for it. I mean if the gc hits marshal somewhere during marshal_load, in any of the rb_*_alloc functions, wouldn't it collect the objects ? Torsten