96 MemRegion _reserved; |
96 MemRegion _reserved; |
97 |
97 |
98 // Memory area reserved for generation |
98 // Memory area reserved for generation |
99 VirtualSpace _virtual_space; |
99 VirtualSpace _virtual_space; |
100 |
100 |
101 // Level in the generation hierarchy. |
|
102 int _level; |
|
103 |
|
104 // ("Weak") Reference processing support |
101 // ("Weak") Reference processing support |
105 ReferenceProcessor* _ref_processor; |
102 ReferenceProcessor* _ref_processor; |
106 |
103 |
107 // Performance Counters |
104 // Performance Counters |
108 CollectorCounters* _gc_counters; |
105 CollectorCounters* _gc_counters; |
109 |
106 |
110 // Statistics for garbage collection |
107 // Statistics for garbage collection |
111 GCStats* _gc_stats; |
108 GCStats* _gc_stats; |
112 |
109 |
113 // Returns the next generation in the configuration, or else NULL if this |
|
114 // is the highest generation. |
|
115 Generation* next_gen() const; |
|
116 |
|
117 // Initialize the generation. |
110 // Initialize the generation. |
118 Generation(ReservedSpace rs, size_t initial_byte_size, int level); |
111 Generation(ReservedSpace rs, size_t initial_byte_size); |
119 |
112 |
120 // Apply "cl->do_oop" to (the address of) (exactly) all the ref fields in |
113 // Apply "cl->do_oop" to (the address of) (exactly) all the ref fields in |
121 // "sp" that point into younger generations. |
114 // "sp" that point into younger generations. |
122 // The iteration is only over objects allocated at the start of the |
115 // The iteration is only over objects allocated at the start of the |
123 // iterations; objects allocated as a result of applying the closure are |
116 // iterations; objects allocated as a result of applying the closure are |
407 |
400 |
408 virtual void update_time_of_last_gc(jlong now) { |
401 virtual void update_time_of_last_gc(jlong now) { |
409 _time_of_last_gc = now; |
402 _time_of_last_gc = now; |
410 } |
403 } |
411 |
404 |
412 // Generations may keep statistics about collection. This |
405 // Generations may keep statistics about collection. This method |
413 // method updates those statistics. current_level is |
406 // updates those statistics. current_generation is the generation |
414 // the level of the collection that has most recently |
407 // that was most recently collected. This allows the generation to |
415 // occurred. This allows the generation to decide what |
408 // decide what statistics are valid to collect. For example, the |
416 // statistics are valid to collect. For example, the |
409 // generation can decide to gather the amount of promoted data if |
417 // generation can decide to gather the amount of promoted data |
410 // the collection of the younger generations has completed. |
418 // if the collection of the younger generations has completed. |
|
419 GCStats* gc_stats() const { return _gc_stats; } |
411 GCStats* gc_stats() const { return _gc_stats; } |
420 virtual void update_gc_stats(int current_level, bool full) {} |
412 virtual void update_gc_stats(Generation* current_generation, bool full) {} |
421 |
413 |
422 // Mark sweep support phase2 |
414 // Mark sweep support phase2 |
423 virtual void prepare_for_compaction(CompactPoint* cp); |
415 virtual void prepare_for_compaction(CompactPoint* cp); |
424 // Mark sweep support phase3 |
416 // Mark sweep support phase3 |
425 virtual void adjust_pointers(); |
417 virtual void adjust_pointers(); |