comparison src/share/vm/gc_implementation/shared/vmGCOperations.cpp @ 139:c0492d52d55b

6539517: CR 6186200 should be extended to perm gen allocation to prevent spurious OOM's from perm gen Reviewed-by: ysr, jmasa
author apetrusenko
date Tue, 01 Apr 2008 15:13:47 +0400
parents a61af66fc99e
children d1605aabd0a1 37f87013dfd8
comparison
equal deleted inserted replaced
95:d05ebaf00ed0 139:c0492d52d55b
142 GenCollectedHeap* gch = GenCollectedHeap::heap(); 142 GenCollectedHeap* gch = GenCollectedHeap::heap();
143 GCCauseSetter gccs(gch, _gc_cause); 143 GCCauseSetter gccs(gch, _gc_cause);
144 gch->do_full_collection(gch->must_clear_all_soft_refs(), _max_level); 144 gch->do_full_collection(gch->must_clear_all_soft_refs(), _max_level);
145 notify_gc_end(); 145 notify_gc_end();
146 } 146 }
147
148 void VM_GenCollectForPermanentAllocation::doit() {
149 JvmtiGCForAllocationMarker jgcm;
150 notify_gc_begin(true);
151 GenCollectedHeap* gch = GenCollectedHeap::heap();
152 GCCauseSetter gccs(gch, _gc_cause);
153 gch->do_full_collection(gch->must_clear_all_soft_refs(),
154 gch->n_gens() - 1);
155 _res = gch->perm_gen()->allocate(_size, false);
156 assert(gch->is_in_reserved_or_null(_res), "result not in heap");
157 if (_res == NULL && GC_locker::is_active_and_needs_gc()) {
158 set_gc_locked();
159 }
160 notify_gc_end();
161 }