< prev index next >

src/hotspot/share/gc/shared/genCollectedHeap.cpp

RFE_8195103_reduce_initial_card_marks

0 /*                                                                                                                         
1  * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.                                            
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.                                                           
3  *                                                                                                                         
4  * This code is free software; you can redistribute it and/or modify it                                                    
5  * under the terms of the GNU General Public License version 2 only, as                                                    
6  * published by the Free Software Foundation.                                                                              
7  *                                                                                                                         
8  * This code is distributed in the hope that it will be useful, but WITHOUT                                                
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or                                                   
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License                                                   
11  * version 2 for more details (a copy is included in the LICENSE file that                                                 
12  * accompanied this code).                                                                                                 
13  *                                                                                                                         
14  * You should have received a copy of the GNU General Public License version                                               
15  * 2 along with this work; if not, write to the Free Software Foundation,                                                  
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.                                                           
17  *                                                                                                                         
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA                                                 
19  * or visit www.oracle.com if you need additional information or have any                                                  
20  * questions.                                                                                                              

0 /*
1  * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
2  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3  *
4  * This code is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 only, as
6  * published by the Free Software Foundation.
7  *
8  * This code is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * version 2 for more details (a copy is included in the LICENSE file that
12  * accompanied this code).
13  *
14  * You should have received a copy of the GNU General Public License version
15  * 2 along with this work; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17  *
18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19  * or visit www.oracle.com if you need additional information or have any
20  * questions.

53 #include "runtime/vmThread.hpp"                                                                                            
54 #include "services/management.hpp"                                                                                         
55 #include "services/memoryService.hpp"                                                                                      
56 #include "utilities/debug.hpp"                                                                                             
57 #include "utilities/formatBuffer.hpp"                                                                                      
58 #include "utilities/macros.hpp"                                                                                            
59 #include "utilities/stack.inline.hpp"                                                                                      
60 #include "utilities/vmError.hpp"                                                                                           
61 
62 GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :                                                           
63   CollectedHeap(),                                                                                                         
64   _rem_set(NULL),                                                                                                          
65   _gen_policy(policy),                                                                                                     
66   _process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),                                                             
67   _full_collections_completed(0)                                                                                           
68 {                                                                                                                          
69   assert(policy != NULL, "Sanity check");                                                                                  
70 }                                                                                                                          
71 
72 jint GenCollectedHeap::initialize() {                                                                                      
73   CollectedHeap::pre_initialize();                                                                                         
74                                                                                                                            
75   // While there are no constraints in the GC code that HeapWordSize                                                       
76   // be any particular value, there are multiple other areas in the                                                        
77   // system which believe this to be true (e.g. oop->object_size in some                                                   
78   // cases incorrectly returns the size in wordSize units rather than                                                      
79   // HeapWordSize).                                                                                                        
80   guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");                                                 
81 
82   // Allocate space for the heap.                                                                                          
83 
84   char* heap_address;                                                                                                      
85   ReservedSpace heap_rs;                                                                                                   
86 
87   size_t heap_alignment = collector_policy()->heap_alignment();                                                            
88 
89   heap_address = allocate(heap_alignment, &heap_rs);                                                                       
90 
91   if (!heap_rs.is_reserved()) {                                                                                            
92     vm_shutdown_during_initialization(                                                                                     
93       "Could not reserve enough space for object heap");                                                                   

53 #include "runtime/vmThread.hpp"
54 #include "services/management.hpp"
55 #include "services/memoryService.hpp"
56 #include "utilities/debug.hpp"
57 #include "utilities/formatBuffer.hpp"
58 #include "utilities/macros.hpp"
59 #include "utilities/stack.inline.hpp"
60 #include "utilities/vmError.hpp"
61 
62 GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy) :
63   CollectedHeap(),
64   _rem_set(NULL),
65   _gen_policy(policy),
66   _process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),
67   _full_collections_completed(0)
68 {
69   assert(policy != NULL, "Sanity check");
70 }
71 
72 jint GenCollectedHeap::initialize() {


73   // While there are no constraints in the GC code that HeapWordSize
74   // be any particular value, there are multiple other areas in the
75   // system which believe this to be true (e.g. oop->object_size in some
76   // cases incorrectly returns the size in wordSize units rather than
77   // HeapWordSize).
78   guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
79 
80   // Allocate space for the heap.
81 
82   char* heap_address;
83   ReservedSpace heap_rs;
84 
85   size_t heap_alignment = collector_policy()->heap_alignment();
86 
87   heap_address = allocate(heap_alignment, &heap_rs);
88 
89   if (!heap_rs.is_reserved()) {
90     vm_shutdown_during_initialization(
91       "Could not reserve enough space for object heap");
< prev index next >