From: Wesley J Landaker Date: 2002-06-10T06:02:44+09:00 Subject: Re: Park and Sean....Possible memory bug in Ruby? I'm stumped! On Sunday 09 June 2002 02:53 pm, Dossy wrote: > On 2002.06.10, Wesley J Landaker wrote: > > The first one creates a file object, does a read, then the file > > object is floating. If and when it gets garbage collected, the file > > will be closed. But if you run a ton of these commands in a row, > > it's extremely easy to open more files than is allowed by the OS > > before the garbage collector ever kicks in. (Perhaps ruby ought to > > catch the error and run the garbage collector, then try again > > transparently?) > You know, this might be the problem I'm experiencing with DBI and > dbd_oracle. > > I never execute StatementHandle#finish -- could I be running out of > statement handles? (Remember, when I explicitly added "GC.start" > to my code, the crash went away.) > > Shouldn't DBI tell me I've run out of statement handles, rather than > segfaulting Ruby? I'm not real familiar with DBI and the dbd_oracle extension, but assuming it's using file descriptors for the statement handles (file descriptors are used for files, sockets, fifos, pipes, etc) the same sort of thing could be happening -- where you have sort of a race between your code and the garbage collector. =) > Maybe I can create a reproducible test case now, if this is why it's > dying ... Good luck, it's a definate possibility. =) -- Wesley J. Landaker - wjl@icecavern.net OpenPGP FP: C99E DF40 54F6 B625 FD48 B509 A3DE 8D79 541F F830