/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "gc_implementation/parallelScavenge/psOldGen.hpp"
#include "gc_implementation/parallelScavenge/psPermGen.hpp"
#include "gc_implementation/parallelScavenge/psYoungGen.hpp"
#include "gc_implementation/shared/gcPolicyCounters.hpp"
#include "gc_interface/collectedHeap.inline.hpp"
#include "utilities/ostream.hpp"
class AdjoiningGenerations;
class CollectorPolicy;
class GCHeapSummary;
class GCTaskManager;
class GenerationSizer;
class CollectorPolicy;
class PSAdaptiveSizePolicy;
class PSHeapSummary;
class VirtualSpaceSummary;
friend class VMStructs;
private:
// Sizing policy for entire heap
// Collection of generations that are adjacent in the
// space reserved for the heap.
unsigned int _death_march_count;
protected:
static inline size_t total_invocations();
public:
_death_march_count = 0;
}
// For use by VM operations
enum CollectionType {
};
return CollectedHeap::ParallelScavengeHeap;
}
// GenerationSizer* collector_policy() const { return _collector_policy; }
static ParallelScavengeHeap* heap();
// Returns JNI_OK on success
virtual jint initialize();
void post_initialize();
void update_counters();
// The alignment used for the various generations.
// The alignment used for eden and survivors within the young gen
// and for boundary between young gen and old gen.
// Return "true" if all generations (but perm) have reached the
// maximal committed limit that they can reach, without a garbage
// collection.
virtual bool is_maximal_no_gc() const;
// Return true if the reference points to an object that
// can be moved in a partial collection. For currently implemented
// generational collectors that means during a collection of
// the young gen.
virtual bool is_scavengable(const void* addr);
// Does this heap support heap inspection? (+PrintClassHistogram)
bool supports_heap_inspection() const { return true; }
size_t permanent_capacity() const;
size_t permanent_used() const;
size_t max_capacity() const;
// Whether p is in the allocated part of the heap
bool is_in(const void* p) const;
bool is_in_reserved(const void* p) const;
}
#ifdef ASSERT
virtual bool is_in_partial_collection(const void *p);
#endif
}
// Memory allocation. "gc_time_limit_was_exceeded" will
// be set to true if the adaptive size policy determine that
// an excessive amount of time is being spent doing collections
// and caused a NULL to be returned. If a NULL is not returned,
// "gc_time_limit_was_exceeded" has an undefined meaning.
bool* gc_overhead_limit_was_exceeded);
// Allocation attempt(s) during a safepoint. It should never be called
// to allocate a new TLAB as this allocation might be satisfied out
// of the old generation.
// Support for System.gc()
// This interface assumes that it's being called by the
// vm thread. It collects the heap assuming that the
// heap lock is already held and that we are executing in
// the context of the vm thread.
// These also should be called by the vm thread at a safepoint (e.g., from a
// VM operation).
//
// The first collects the young generation only, unless the scavenge fails; it
// will then attempt a full gc. The second collects the entire heap; if
// maximum_compaction is true, it will compact everything and clear all soft
// references.
inline void invoke_scavenge();
inline void invoke_full_gc(bool maximum_compaction);
void ensure_parsability(bool retire_tlabs);
void accumulate_statistics_all_tlabs();
void resize_all_tlabs();
bool supports_tlab_allocation() const { return true; }
// Can a compiler initialize a new object without store barriers?
// This permission only extends from the creation of a new object
// via a TLAB up to the first subsequent safepoint.
virtual bool can_elide_tlab_store_barriers() const {
return true;
}
virtual bool card_mark_must_follow_store() const {
return false;
}
// Return true if we don't we need a store barrier for
// initializing stores to an object at this address.
// Can a compiler elide a store barrier when it writes
// a permanent oop into the heap? Applies when the compiler
// is storing x to the heap, where x->is_perm() is true.
virtual bool can_elide_permanent_oop_store_barriers() const {
return true;
}
void prepare_for_verify();
virtual void print_tracing_info() const;
// Resize the young generation. The reserved space for the
// generation may be expanded in preparation for the resize.
// Resize the old generation. The reserved space for the
// generation may be expanded in preparation for the resize.
// Save the tops of the spaces in all generations
// Mangle the unused parts of all spaces in the heap
// Call these in sequential code around the processing of strong roots.
public:
};
};
{
return var;
}
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PARALLELSCAVENGEHEAP_HPP