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 // This class (or more correctly, subtypes of this class) 26 // are used to define global garbage collector attributes. 27 // This includes initialization of generations and any other 28 // shared resources they may need. 29 // 30 // In general, all flag adjustment and validation should be 31 // done in initialize_flags(), which is called prior to 32 // initialize_size_info(). 33 // 34 // This class is not fully developed yet. As more collector(s) 35 // are added, it is expected that we will come across further 36 // behavior that requires global attention. The correct place 37 // to deal with those issues is this class. 38 39 // Forward declarations. 40 class GenCollectorPolicy; 41 class TwoGenerationCollectorPolicy; 42 class AdaptiveSizePolicy; 43 #ifndef SERIALGC 44 class ConcurrentMarkSweepPolicy; 317 virtual CollectorPolicy::Name kind() { 318 return CollectorPolicy::TwoGenerationCollectorPolicyKind; 319 } 320 321 // Returns true is gen0 sizes were adjusted 322 bool adjust_gen0_sizes(size_t* gen0_size_ptr, size_t* gen1_size_ptr, 323 size_t heap_size, size_t min_gen1_size); 324 }; 325 326 class MarkSweepPolicy : public TwoGenerationCollectorPolicy { 327 protected: 328 void initialize_generations(); 329 330 public: 331 MarkSweepPolicy(); 332 333 MarkSweepPolicy* as_mark_sweep_policy() { return this; } 334 335 void initialize_gc_policy_counters(); 336 }; | 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_COLLECTORPOLICY_HPP 26 #define SHARE_VM_MEMORY_COLLECTORPOLICY_HPP 27 28 #include "memory/barrierSet.hpp" 29 #include "memory/genRemSet.hpp" 30 #include "memory/permGen.hpp" 31 32 // This class (or more correctly, subtypes of this class) 33 // are used to define global garbage collector attributes. 34 // This includes initialization of generations and any other 35 // shared resources they may need. 36 // 37 // In general, all flag adjustment and validation should be 38 // done in initialize_flags(), which is called prior to 39 // initialize_size_info(). 40 // 41 // This class is not fully developed yet. As more collector(s) 42 // are added, it is expected that we will come across further 43 // behavior that requires global attention. The correct place 44 // to deal with those issues is this class. 45 46 // Forward declarations. 47 class GenCollectorPolicy; 48 class TwoGenerationCollectorPolicy; 49 class AdaptiveSizePolicy; 50 #ifndef SERIALGC 51 class ConcurrentMarkSweepPolicy; 324 virtual CollectorPolicy::Name kind() { 325 return CollectorPolicy::TwoGenerationCollectorPolicyKind; 326 } 327 328 // Returns true is gen0 sizes were adjusted 329 bool adjust_gen0_sizes(size_t* gen0_size_ptr, size_t* gen1_size_ptr, 330 size_t heap_size, size_t min_gen1_size); 331 }; 332 333 class MarkSweepPolicy : public TwoGenerationCollectorPolicy { 334 protected: 335 void initialize_generations(); 336 337 public: 338 MarkSweepPolicy(); 339 340 MarkSweepPolicy* as_mark_sweep_policy() { return this; } 341 342 void initialize_gc_policy_counters(); 343 }; 344 345 #endif // SHARE_VM_MEMORY_COLLECTORPOLICY_HPP |