comparison src/share/vm/gc_implementation/parallelScavenge/vmPSOperations.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents c9ca3f51cf41
children 4bfc44ba0d19
comparison
equal deleted inserted replaced
6724:36d1d483d5d6 6725:da91efe96a93
1 /* 1 /*
2 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
52 if (_result == NULL && GC_locker::is_active_and_needs_gc()) { 52 if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
53 set_gc_locked(); 53 set_gc_locked();
54 } 54 }
55 } 55 }
56 56
57 VM_ParallelGCFailedPermanentAllocation::VM_ParallelGCFailedPermanentAllocation(size_t size,
58 unsigned int gc_count, unsigned int full_gc_count) :
59 VM_GC_Operation(gc_count, GCCause::_allocation_failure, full_gc_count, true /* full */),
60 _size(size),
61 _result(NULL)
62 {
63 }
64
65 void VM_ParallelGCFailedPermanentAllocation::doit() {
66 SvcGCMarker sgcm(SvcGCMarker::FULL);
67
68 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap();
69 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "must be a ParallelScavengeHeap");
70
71 GCCauseSetter gccs(heap, _gc_cause);
72 _result = heap->failed_permanent_mem_allocate(_size);
73 if (_result == NULL && GC_locker::is_active_and_needs_gc()) {
74 set_gc_locked();
75 }
76 }
77
78 // Only used for System.gc() calls 57 // Only used for System.gc() calls
79 VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count, 58 VM_ParallelGCSystemGC::VM_ParallelGCSystemGC(unsigned int gc_count,
80 unsigned int full_gc_count, 59 unsigned int full_gc_count,
81 GCCause::Cause gc_cause) : 60 GCCause::Cause gc_cause) :
82 VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */) 61 VM_GC_Operation(gc_count, gc_cause, full_gc_count, true /* full */)
94 if (_gc_cause == GCCause::_gc_locker 73 if (_gc_cause == GCCause::_gc_locker
95 DEBUG_ONLY(|| _gc_cause == GCCause::_scavenge_alot)) { 74 DEBUG_ONLY(|| _gc_cause == GCCause::_scavenge_alot)) {
96 // If (and only if) the scavenge fails, this will invoke a full gc. 75 // If (and only if) the scavenge fails, this will invoke a full gc.
97 heap->invoke_scavenge(); 76 heap->invoke_scavenge();
98 } else { 77 } else {
99 heap->invoke_full_gc(false); 78 heap->do_full_collection(false);
100 } 79 }
101 } 80 }