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.
This commit is contained in:
Joel Dice 2013-02-03 15:20:53 -07:00
parent 3db9e73aa1
commit 23bb2e8743

View File

@ -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);