Mercurial > hg > graal-jvmci-8
diff src/share/vm/gc_implementation/parNew/parNewGeneration.cpp @ 263:12eea04c8b06
6672698: mangle_unused_area() should not remangle the entire heap at each collection.
Summary: Maintain a high water mark for the allocations in a space and mangle only up to that high water mark.
Reviewed-by: ysr, apetrusenko
author | jmasa |
---|---|
date | Wed, 09 Jul 2008 15:08:55 -0700 |
parents | feeb96a45707 |
children | 850fdf70db2b |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Fri Jun 27 19:12:11 2008 -0700 +++ b/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp Wed Jul 09 15:08:55 2008 -0700 @@ -727,7 +727,7 @@ SpecializationStats::clear(); age_table()->clear(); - to()->clear(); + to()->clear(SpaceDecorator::Mangle); gch->save_marks(); assert(workers != NULL, "Need parallel worker threads."); @@ -793,8 +793,18 @@ } if (!promotion_failed()) { // Swap the survivor spaces. - eden()->clear(); - from()->clear(); + eden()->clear(SpaceDecorator::Mangle); + from()->clear(SpaceDecorator::Mangle); + if (ZapUnusedHeapArea) { + // This is now done here because of the piece-meal mangling which + // can check for valid mangling at intermediate points in the + // collection(s). When a minor collection fails to collect + // sufficient space resizing of the young generation can occur + // an redistribute the spaces in the young generation. Mangle + // here so that unzapped regions don't get distributed to + // other spaces. + to()->mangle_unused_area(); + } swap_spaces(); assert(to()->is_empty(), "to space should be empty now");