From 23bb2e87433b5dd8db56c19891824b6e42a81c37 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Sun, 3 Feb 2013 15:20:53 -0700 Subject: [PATCH] force a GC in allocate3 if the heap limit has been exceeded Otherwise, we'll throw an OOME even though there may be enough unreachable objects eligible for collection to get back below the limit. --- src/machine.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/machine.cpp b/src/machine.cpp index 0d0ad96865..7986a5be78 100644 --- a/src/machine.cpp +++ b/src/machine.cpp @@ -3519,7 +3519,7 @@ allocate3(Thread* t, Allocator* allocator, Machine::AllocationType type, break; } - if (t->heap == 0) { + if (t->heap == 0 or t->m->heap->limitExceeded()) { // fprintf(stderr, "gc"); // vmPrintTrace(t); collect(t, Heap::MinorCollection);