mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8008508: CMS does not correctly reduce heap size after a Full GC
Reviewed-by: johnc, ysr
This commit is contained in:
parent
90d010120f
commit
fabb8c6e25
7 changed files with 269 additions and 230 deletions
|
@ -634,6 +634,17 @@ class CardGeneration: public Generation {
|
|||
// This is local to this generation.
|
||||
BlockOffsetSharedArray* _bts;
|
||||
|
||||
// current shrinking effect: this damps shrinking when the heap gets empty.
|
||||
size_t _shrink_factor;
|
||||
|
||||
size_t _min_heap_delta_bytes; // Minimum amount to expand.
|
||||
|
||||
// Some statistics from before gc started.
|
||||
// These are gathered in the gc_prologue (and should_collect)
|
||||
// to control growing/shrinking policy in spite of promotions.
|
||||
size_t _capacity_at_prologue;
|
||||
size_t _used_at_prologue;
|
||||
|
||||
CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level,
|
||||
GenRemSet* remset);
|
||||
|
||||
|
@ -644,6 +655,11 @@ class CardGeneration: public Generation {
|
|||
// necessarily the full "bytes") was done.
|
||||
virtual bool expand(size_t bytes, size_t expand_bytes);
|
||||
|
||||
// Shrink generation with specified size (returns false if unable to shrink)
|
||||
virtual void shrink(size_t bytes) = 0;
|
||||
|
||||
virtual void compute_new_size();
|
||||
|
||||
virtual void clear_remembered_set();
|
||||
|
||||
virtual void invalidate_remembered_set();
|
||||
|
@ -667,7 +683,6 @@ class OneContigSpaceCardGeneration: public CardGeneration {
|
|||
friend class VM_PopulateDumpSharedSpace;
|
||||
|
||||
protected:
|
||||
size_t _min_heap_delta_bytes; // Minimum amount to expand.
|
||||
ContiguousSpace* _the_space; // actual space holding objects
|
||||
WaterMark _last_gc; // watermark between objects allocated before
|
||||
// and after last GC.
|
||||
|
@ -688,11 +703,10 @@ class OneContigSpaceCardGeneration: public CardGeneration {
|
|||
|
||||
public:
|
||||
OneContigSpaceCardGeneration(ReservedSpace rs, size_t initial_byte_size,
|
||||
size_t min_heap_delta_bytes,
|
||||
int level, GenRemSet* remset,
|
||||
ContiguousSpace* space) :
|
||||
CardGeneration(rs, initial_byte_size, level, remset),
|
||||
_the_space(space), _min_heap_delta_bytes(min_heap_delta_bytes)
|
||||
_the_space(space)
|
||||
{}
|
||||
|
||||
inline bool is_in(const void* p) const;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue