diff -r 68fe50d4f1d5 -r 8617e38bb4cb src/share/vm/memory/generation.hpp --- a/src/share/vm/memory/generation.hpp Fri Apr 05 10:20:04 2013 -0700 +++ b/src/share/vm/memory/generation.hpp Mon Feb 11 10:31:56 2013 -0800 @@ -634,6 +634,17 @@ // 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 @@ // 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 @@ 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 @@ 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;