David Holmes wrote:
Chris Gray wrote:

I found one gotcha with using a pre-allocated OutOfMemoryError :
if several threads throw OOME at the same time, the stack traces
can get mixed up.


This is one of our issues too.

Here's our approach:


if (VM.debugOOM || Options.verbose >= 5)
VM.sysWriteln("triggerCollection(): About to try \"new OutOfMemoryError()\"");
MM_Interface.emergencyGrowHeap(512 * (1 << 10)); // 512K should be plenty to make an exn
OutOfMemoryError oome = new OutOfMemoryError();
MM_Interface.emergencyGrowHeap(- (512 * (1 << 10)));
if (VM.debugOOM || Options.verbose >= 5)
VM.sysWriteln("triggerCollection(): Allocated the new OutOfMemoryError().");
throw oome;


Of course, we have the advantage of not targeting the embedded space.

--Steve Augart

--
Steven Augart

Jikes RVM, open source Research Virtual Machine:
http://oss.software.ibm.com/jikesrvm

Office: +1 914/784-6743
T.J. Watson Research Center, IBM


_______________________________________________ Classpath mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to