src/share/vm/memory/generation.cpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 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 # include "incls/_precompiled.incl"
  26 # include "incls/_generation.cpp.incl"
















  27 
  28 Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
  29   _level(level),
  30   _ref_processor(NULL) {
  31   if (!_virtual_space.initialize(rs, initial_size)) {
  32     vm_exit_during_initialization("Could not reserve enough space for "
  33                     "object heap");
  34   }
  35   // Mangle all of the the initial generation.
  36   if (ZapUnusedHeapArea) {
  37     MemRegion mangle_region((HeapWord*)_virtual_space.low(),
  38       (HeapWord*)_virtual_space.high());
  39     SpaceMangler::mangle_region(mangle_region);
  40   }
  41   _reserved = MemRegion((HeapWord*)_virtual_space.low_boundary(),
  42           (HeapWord*)_virtual_space.high_boundary());
  43 }
  44 
  45 GenerationSpec* Generation::spec() {
  46   GenCollectedHeap* gch = GenCollectedHeap::heap();


   1 /*
   2  * Copyright (c) 1997, 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 "gc_implementation/shared/spaceDecorator.hpp"
  27 #include "gc_interface/collectedHeap.inline.hpp"
  28 #include "memory/allocation.inline.hpp"
  29 #include "memory/blockOffsetTable.inline.hpp"
  30 #include "memory/cardTableRS.hpp"
  31 #include "memory/gcLocker.inline.hpp"
  32 #include "memory/genCollectedHeap.hpp"
  33 #include "memory/genMarkSweep.hpp"
  34 #include "memory/genOopClosures.hpp"
  35 #include "memory/genOopClosures.inline.hpp"
  36 #include "memory/generation.hpp"
  37 #include "memory/generation.inline.hpp"
  38 #include "memory/space.inline.hpp"
  39 #include "oops/oop.inline.hpp"
  40 #include "runtime/java.hpp"
  41 #include "utilities/copy.hpp"
  42 #include "utilities/events.hpp"
  43 
  44 Generation::Generation(ReservedSpace rs, size_t initial_size, int level) :
  45   _level(level),
  46   _ref_processor(NULL) {
  47   if (!_virtual_space.initialize(rs, initial_size)) {
  48     vm_exit_during_initialization("Could not reserve enough space for "
  49                     "object heap");
  50   }
  51   // Mangle all of the the initial generation.
  52   if (ZapUnusedHeapArea) {
  53     MemRegion mangle_region((HeapWord*)_virtual_space.low(),
  54       (HeapWord*)_virtual_space.high());
  55     SpaceMangler::mangle_region(mangle_region);
  56   }
  57   _reserved = MemRegion((HeapWord*)_virtual_space.low_boundary(),
  58           (HeapWord*)_virtual_space.high_boundary());
  59 }
  60 
  61 GenerationSpec* Generation::spec() {
  62   GenCollectedHeap* gch = GenCollectedHeap::heap();