comparison src/share/vm/memory/permGen.hpp @ 1839:e41cd7fd68a6

6794422: Perm gen expansion policy for concurrent collectors Summary: Concurrent collectors should expand the perm gen without a full STW GC, but possibly by triggering a concurrent collection. Temporary band-aid for G1 where no concurrent collection is kicked off since the perm gen is not collected concurrently. Reviewed-by: johnc
author ysr
date Fri, 01 Oct 2010 16:12:54 -0700
parents c18cbe5936b8
children f95d63e2154a
comparison
equal deleted inserted replaced
1838:8f6f7587d292 1839:e41cd7fd68a6
1 /* 1 /*
2 * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2000, 2010, 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.
28 28
29 class Generation; 29 class Generation;
30 class GenRemSet; 30 class GenRemSet;
31 class CSpaceCounters; 31 class CSpaceCounters;
32 32
33 // PermGen models the part of the heap 33 // PermGen models the part of the heap used to allocate class meta-data.
34 34
35 class PermGen : public CHeapObj { 35 class PermGen : public CHeapObj {
36 friend class VMStructs; 36 friend class VMStructs;
37 protected: 37 protected:
38 size_t _capacity_expansion_limit; // maximum expansion allowed without a 38 size_t _capacity_expansion_limit; // maximum expansion allowed without a
39 // full gc occurring 39 // full gc occurring
40 void set_capacity_expansion_limit(size_t limit) {
41 assert_locked_or_safepoint(Heap_lock);
42 _capacity_expansion_limit = limit;
43 }
40 44
41 HeapWord* mem_allocate_in_gen(size_t size, Generation* gen); 45 HeapWord* mem_allocate_in_gen(size_t size, Generation* gen);
46 // Along with mem_allocate_in_gen() above, implements policy for
47 // "scheduling" allocation/expansion/collection of the perm gen.
48 // The virtual method request_...() below can be overridden by
49 // subtypes that want to implement a different expansion/collection
50 // policy from the default provided.
51 virtual HeapWord* request_expand_and_allocate(Generation* gen, size_t size,
52 GCCause::Cause prev_cause);
42 53
43 public: 54 public:
44 enum Name { 55 enum Name {
45 MarkSweepCompact, MarkSweep, ConcurrentMarkSweep 56 MarkSweepCompact, MarkSweep, ConcurrentMarkSweep
46 }; 57 };