From: Dennis Newbold Date: 2002-05-02T08:53:01+09:00 Subject: Re: some questions about rb_newobj() On Wed, 1 May 2002, Yukihiro Matsumoto wrote: > > |Is it possible for this function to raise an exception? (It's desirable > |that it can't since that would mean that Data_Wrap_Struct can't raise > |either, which makes my job as an extension writer easier). > > Unfortunately it may raise an exception when there's no memory left. > > matz. I'm a bit confused by the concept of "no memory left". On Windows and all the variants of Unix that I'm aware of, the OS provides each process with a multi-gigabyte, (an don some systems, terabyte) virtual address space, supported by a swap file or swap partition. If malloc() runs out or room on the heap it just calls brk() or sbrk() (I forget which) to get some more. Under such circumstances, I find it difficult to imagine a real-world scenario which would result in an "out of memory" error condition. Am I missing something here? Or does Ruby have an artificial internal limit on the amount of memory it can work with? Perhaps due to the implementation of the garbage collector, or something? If there is such a limitation, can you tell me what it is? Thanks. Dennis