1 /*
2 * Copyright (c) 2001, 2015, 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 *
27 #include "gc/serial/tenuredGeneration.inline.hpp"
28 #include "gc/shared/blockOffsetTable.inline.hpp"
29 #include "gc/shared/cardGeneration.inline.hpp"
30 #include "gc/shared/collectorCounters.hpp"
31 #include "gc/shared/gcTimer.hpp"
32 #include "gc/shared/gcTrace.hpp"
33 #include "gc/shared/genOopClosures.inline.hpp"
34 #include "gc/shared/generationSpec.hpp"
35 #include "gc/shared/space.hpp"
36 #include "logging/log.hpp"
37 #include "memory/allocation.inline.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "runtime/java.hpp"
40 #include "utilities/macros.hpp"
41 #if INCLUDE_ALL_GCS
42 #include "gc/cms/parOopClosures.hpp"
43 #endif
44
45 TenuredGeneration::TenuredGeneration(ReservedSpace rs,
46 size_t initial_byte_size,
47 CardTableRS* remset) :
48 CardGeneration(rs, initial_byte_size, remset)
49 {
50 HeapWord* bottom = (HeapWord*) _virtual_space.low();
51 HeapWord* end = (HeapWord*) _virtual_space.high();
52 _the_space = new TenuredSpace(_bts, MemRegion(bottom, end));
53 _the_space->reset_saved_mark();
54 _shrink_factor = 0;
55 _capacity_at_prologue = 0;
56
57 _gc_stats = new GCStats();
58
59 // initialize performance counters
60
61 const char* gen_name = "old";
62 GenCollectorPolicy* gcp = GenCollectedHeap::heap()->gen_policy();
63 // Generation Counters -- generation 1, 1 subspace
64 _gen_counters = new GenerationCounters(gen_name, 1, 1,
65 gcp->min_old_size(), gcp->max_old_size(), &_virtual_space);
66
67 _gc_counters = new CollectorCounters("MSC", 1);
68
|
1 /*
2 * Copyright (c) 2001, 2017, 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 *
27 #include "gc/serial/tenuredGeneration.inline.hpp"
28 #include "gc/shared/blockOffsetTable.inline.hpp"
29 #include "gc/shared/cardGeneration.inline.hpp"
30 #include "gc/shared/collectorCounters.hpp"
31 #include "gc/shared/gcTimer.hpp"
32 #include "gc/shared/gcTrace.hpp"
33 #include "gc/shared/genOopClosures.inline.hpp"
34 #include "gc/shared/generationSpec.hpp"
35 #include "gc/shared/space.hpp"
36 #include "logging/log.hpp"
37 #include "memory/allocation.inline.hpp"
38 #include "oops/oop.inline.hpp"
39 #include "runtime/java.hpp"
40 #include "utilities/macros.hpp"
41 #if INCLUDE_ALL_GCS
42 #include "gc/cms/parOopClosures.hpp"
43 #endif
44
45 TenuredGeneration::TenuredGeneration(ReservedSpace rs,
46 size_t initial_byte_size,
47 GCMemoryManager* mem_mgr,
48 CardTableRS* remset) :
49 CardGeneration(rs, initial_byte_size, mem_mgr, remset)
50 {
51 HeapWord* bottom = (HeapWord*) _virtual_space.low();
52 HeapWord* end = (HeapWord*) _virtual_space.high();
53 _the_space = new TenuredSpace(_bts, MemRegion(bottom, end));
54 _the_space->reset_saved_mark();
55 _shrink_factor = 0;
56 _capacity_at_prologue = 0;
57
58 _gc_stats = new GCStats();
59
60 // initialize performance counters
61
62 const char* gen_name = "old";
63 GenCollectorPolicy* gcp = GenCollectedHeap::heap()->gen_policy();
64 // Generation Counters -- generation 1, 1 subspace
65 _gen_counters = new GenerationCounters(gen_name, 1, 1,
66 gcp->min_old_size(), gcp->max_old_size(), &_virtual_space);
67
68 _gc_counters = new CollectorCounters("MSC", 1);
69
|