> The > only tricky part is that exception itself might require some memory for > handling it. > This is actually pretty easily handled; allocate the exception object and a buffer for holding the message(s) at VM startup, and simply throw this instance when the out-of-memory condition occurs. I don't know if you gather a stack trace at the time the exception is allocated (a la JVM and CLR exceptions), but even then, space for the stack trace itself (or at least the topmost "n" elements) can be preallocated and filled in, I would think?
Ted Neward Java, .NET, XML Services Consulting, Teaching, Speaking, Writing http://www.tedneward.com > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:neko- > [EMAIL PROTECTED] On Behalf Of Nicolas Cannasse > Sent: Wednesday, April 16, 2008 5:25 AM > To: Michael Pliskin; Neko intermediate language mailing list > Subject: Re: [Neko] NGinx and NekoVM? > > Michael Pliskin a écrit : > > Hello all, > > > > Coming back to this old subject: I had a chance to talk to Igor > > (nginx author) in person (at a conference in Moscow yesterday), and > > the only problem he is having integrating Neko is that he wants VM > > to fail gracefully in case of out-of-memory - and all VMs are just > > crashing or whatever instead (at least what he claims). > > > > So Nicolas, any comments on that? > > > > Mike > > All memory allocations of nekovm are centralized in the vm/alloc.c > file. > > It would be possible to assign some kind of memory limitation to the GC > and when the GC fail to allocate some block, throw a Neko exception. > The > only tricky part is that exception itself might require some memory for > handling it. > > Also, the notion of out-of-memory is blurry on modern systems since > most > of the time OS use swap file in such cases. > > Best, > Nicolas > > -- > Neko : One VM to run them all > (http://nekovm.org) > > No virus found in this incoming message. > Checked by AVG. > Version: 7.5.519 / Virus Database: 269.22.13/1378 - Release Date: > 4/15/2008 9:12 AM > No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.13/1378 - Release Date: 4/15/2008 9:12 AM -- Neko : One VM to run them all (http://nekovm.org)
