set flag useNewPing. static A memLimit(long allocationLimit, IF0 f) { if (f == null) null; long baseline = bytesAllocatedByCurrentThread(); long limit = baseline+allocationLimit; temp tempNewPing_addToStack(r { if (bytesAllocatedByCurrentThread() > limit) fail("Allocation limit for " + f + " exceeded: " + toM(allocationLimit) + " MB"); }); A a = f.get(); ping(); ret a; }