1.1 --- a/src/share/vm/memory/generation.hpp Fri Apr 05 10:20:04 2013 -0700 1.2 +++ b/src/share/vm/memory/generation.hpp Mon Feb 11 10:31:56 2013 -0800 1.3 @@ -634,6 +634,17 @@ 1.4 // This is local to this generation. 1.5 BlockOffsetSharedArray* _bts; 1.6 1.7 + // current shrinking effect: this damps shrinking when the heap gets empty. 1.8 + size_t _shrink_factor; 1.9 + 1.10 + size_t _min_heap_delta_bytes; // Minimum amount to expand. 1.11 + 1.12 + // Some statistics from before gc started. 1.13 + // These are gathered in the gc_prologue (and should_collect) 1.14 + // to control growing/shrinking policy in spite of promotions. 1.15 + size_t _capacity_at_prologue; 1.16 + size_t _used_at_prologue; 1.17 + 1.18 CardGeneration(ReservedSpace rs, size_t initial_byte_size, int level, 1.19 GenRemSet* remset); 1.20 1.21 @@ -644,6 +655,11 @@ 1.22 // necessarily the full "bytes") was done. 1.23 virtual bool expand(size_t bytes, size_t expand_bytes); 1.24 1.25 + // Shrink generation with specified size (returns false if unable to shrink) 1.26 + virtual void shrink(size_t bytes) = 0; 1.27 + 1.28 + virtual void compute_new_size(); 1.29 + 1.30 virtual void clear_remembered_set(); 1.31 1.32 virtual void invalidate_remembered_set(); 1.33 @@ -667,7 +683,6 @@ 1.34 friend class VM_PopulateDumpSharedSpace; 1.35 1.36 protected: 1.37 - size_t _min_heap_delta_bytes; // Minimum amount to expand. 1.38 ContiguousSpace* _the_space; // actual space holding objects 1.39 WaterMark _last_gc; // watermark between objects allocated before 1.40 // and after last GC. 1.41 @@ -688,11 +703,10 @@ 1.42 1.43 public: 1.44 OneContigSpaceCardGeneration(ReservedSpace rs, size_t initial_byte_size, 1.45 - size_t min_heap_delta_bytes, 1.46 int level, GenRemSet* remset, 1.47 ContiguousSpace* space) : 1.48 CardGeneration(rs, initial_byte_size, level, remset), 1.49 - _the_space(space), _min_heap_delta_bytes(min_heap_delta_bytes) 1.50 + _the_space(space) 1.51 {} 1.52 1.53 inline bool is_in(const void* p) const;