1 /* 2 * Copyright (c) 2003, 2006, 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 # include "incls/_precompiled.incl" 26 # include "incls/_memoryService.cpp.incl" 27 28 GrowableArray<MemoryPool*>* MemoryService::_pools_list = 29 new (ResourceObj::C_HEAP) GrowableArray<MemoryPool*>(init_pools_list_size, true); 30 GrowableArray<MemoryManager*>* MemoryService::_managers_list = 31 new (ResourceObj::C_HEAP) GrowableArray<MemoryManager*>(init_managers_list_size, true); 32 33 GCMemoryManager* MemoryService::_minor_gc_manager = NULL; 34 GCMemoryManager* MemoryService::_major_gc_manager = NULL; 35 MemoryPool* MemoryService::_code_heap_pool = NULL; 36 37 class GcThreadCountClosure: public ThreadClosure { 38 private: 39 int _count; 40 public: 41 GcThreadCountClosure() : _count(0) {}; 42 void do_thread(Thread* thread); 43 int count() { return _count; } 44 }; 45 46 void GcThreadCountClosure::do_thread(Thread* thread) { | 1 /* 2 * Copyright (c) 2003, 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 #include "precompiled.hpp" 26 #include "classfile/systemDictionary.hpp" 27 #include "classfile/vmSymbols.hpp" 28 #include "gc_implementation/shared/mutableSpace.hpp" 29 #include "memory/collectorPolicy.hpp" 30 #include "memory/defNewGeneration.hpp" 31 #include "memory/genCollectedHeap.hpp" 32 #include "memory/generation.hpp" 33 #include "memory/generationSpec.hpp" 34 #include "memory/heap.hpp" 35 #include "memory/memRegion.hpp" 36 #include "memory/permGen.hpp" 37 #include "memory/tenuredGeneration.hpp" 38 #include "oops/oop.inline.hpp" 39 #include "runtime/javaCalls.hpp" 40 #include "services/classLoadingService.hpp" 41 #include "services/lowMemoryDetector.hpp" 42 #include "services/management.hpp" 43 #include "services/memoryManager.hpp" 44 #include "services/memoryPool.hpp" 45 #include "services/memoryService.hpp" 46 #include "utilities/growableArray.hpp" 47 #ifndef SERIALGC 48 #include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp" 49 #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.hpp" 50 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp" 51 #include "gc_implementation/parNew/parNewGeneration.hpp" 52 #include "gc_implementation/parallelScavenge/parallelScavengeHeap.hpp" 53 #include "gc_implementation/parallelScavenge/psOldGen.hpp" 54 #include "gc_implementation/parallelScavenge/psPermGen.hpp" 55 #include "gc_implementation/parallelScavenge/psYoungGen.hpp" 56 #include "services/g1MemoryPool.hpp" 57 #include "services/psMemoryPool.hpp" 58 #endif 59 60 GrowableArray<MemoryPool*>* MemoryService::_pools_list = 61 new (ResourceObj::C_HEAP) GrowableArray<MemoryPool*>(init_pools_list_size, true); 62 GrowableArray<MemoryManager*>* MemoryService::_managers_list = 63 new (ResourceObj::C_HEAP) GrowableArray<MemoryManager*>(init_managers_list_size, true); 64 65 GCMemoryManager* MemoryService::_minor_gc_manager = NULL; 66 GCMemoryManager* MemoryService::_major_gc_manager = NULL; 67 MemoryPool* MemoryService::_code_heap_pool = NULL; 68 69 class GcThreadCountClosure: public ThreadClosure { 70 private: 71 int _count; 72 public: 73 GcThreadCountClosure() : _count(0) {}; 74 void do_thread(Thread* thread); 75 int count() { return _count; } 76 }; 77 78 void GcThreadCountClosure::do_thread(Thread* thread) { |