1 /*
2 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 class SubTasksDone;
26
27 // A "GenCollectedHeap" is a SharedHeap that uses generational
28 // collection. It is represented with a sequence of Generation's.
29 class GenCollectedHeap : public SharedHeap {
30 friend class GenCollectorPolicy;
31 friend class Generation;
32 friend class DefNewGeneration;
33 friend class TenuredGeneration;
34 friend class ConcurrentMarkSweepGeneration;
35 friend class CMSCollector;
36 friend class GenMarkSweep;
37 friend class VM_GenCollectForAllocation;
38 friend class VM_GenCollectForPermanentAllocation;
39 friend class VM_GenCollectFull;
40 friend class VM_GenCollectFullConcurrent;
41 friend class VM_GC_HeapInspection;
42 friend class VM_HeapDumper;
43 friend class HeapInspection;
44 friend class GCCauseSetter;
518 // collect() and collect_locked(). Caller holds the Heap_lock on entry.
519 void collect_locked(GCCause::Cause cause, int max_level);
520
521 // Returns success or failure.
522 bool create_cms_collector();
523
524 // In support of ExplicitGCInvokesConcurrent functionality
525 bool should_do_concurrent_full_gc(GCCause::Cause cause);
526 void collect_mostly_concurrent(GCCause::Cause cause);
527
528 // Save the tops of the spaces in all generations
529 void record_gen_tops_before_GC() PRODUCT_RETURN;
530
531 protected:
532 virtual void gc_prologue(bool full);
533 virtual void gc_epilogue(bool full);
534
535 public:
536 virtual void preload_and_dump(TRAPS) KERNEL_RETURN;
537 };
|
1 /*
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.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
26 #define SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
27
28 #include "gc_implementation/shared/adaptiveSizePolicy.hpp"
29 #include "memory/collectorPolicy.hpp"
30 #include "memory/generation.hpp"
31 #include "memory/sharedHeap.hpp"
32
33 class SubTasksDone;
34
35 // A "GenCollectedHeap" is a SharedHeap that uses generational
36 // collection. It is represented with a sequence of Generation's.
37 class GenCollectedHeap : public SharedHeap {
38 friend class GenCollectorPolicy;
39 friend class Generation;
40 friend class DefNewGeneration;
41 friend class TenuredGeneration;
42 friend class ConcurrentMarkSweepGeneration;
43 friend class CMSCollector;
44 friend class GenMarkSweep;
45 friend class VM_GenCollectForAllocation;
46 friend class VM_GenCollectForPermanentAllocation;
47 friend class VM_GenCollectFull;
48 friend class VM_GenCollectFullConcurrent;
49 friend class VM_GC_HeapInspection;
50 friend class VM_HeapDumper;
51 friend class HeapInspection;
52 friend class GCCauseSetter;
526 // collect() and collect_locked(). Caller holds the Heap_lock on entry.
527 void collect_locked(GCCause::Cause cause, int max_level);
528
529 // Returns success or failure.
530 bool create_cms_collector();
531
532 // In support of ExplicitGCInvokesConcurrent functionality
533 bool should_do_concurrent_full_gc(GCCause::Cause cause);
534 void collect_mostly_concurrent(GCCause::Cause cause);
535
536 // Save the tops of the spaces in all generations
537 void record_gen_tops_before_GC() PRODUCT_RETURN;
538
539 protected:
540 virtual void gc_prologue(bool full);
541 virtual void gc_epilogue(bool full);
542
543 public:
544 virtual void preload_and_dump(TRAPS) KERNEL_RETURN;
545 };
546
547 #endif // SHARE_VM_MEMORY_GENCOLLECTEDHEAP_HPP
|