Mercurial > hg > graal-jvmci-8
diff src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp @ 10288:eba99d16dc6f
8007763: Refactoring: split up compute_generation_free_space() into two functions for class PSAdaptiveSizePolicy
Summary: split up compute_generation_free_space() into two functions: compute_eden_space_size() + compute_old_gen_free_space(), each of which (if needed) can be reused without executing an overhead of the other.
Reviewed-by: jmasa, tschatzl
Contributed-by: tamao <tao.mao@oracle.com>
author | tamao |
---|---|
date | Wed, 15 May 2013 10:41:22 -0700 |
parents | 4868caa99ecf |
children | 001ec9515f84 |
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed May 15 11:05:09 2013 +0200 +++ b/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp Wed May 15 10:41:22 2013 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2084,19 +2084,36 @@ young_gen->from_space()->capacity_in_bytes() + young_gen->to_space()->capacity_in_bytes(), "Sizes of space in young gen are out-of-bounds"); + + size_t young_live = young_gen->used_in_bytes(); + size_t eden_live = young_gen->eden_space()->used_in_bytes(); + size_t old_live = old_gen->used_in_bytes(); + size_t cur_eden = young_gen->eden_space()->capacity_in_bytes(); + size_t max_old_gen_size = old_gen->max_gen_size(); size_t max_eden_size = young_gen->max_size() - young_gen->from_space()->capacity_in_bytes() - young_gen->to_space()->capacity_in_bytes(); - size_policy->compute_generation_free_space( - young_gen->used_in_bytes(), - young_gen->eden_space()->used_in_bytes(), - old_gen->used_in_bytes(), - young_gen->eden_space()->capacity_in_bytes(), - old_gen->max_gen_size(), - max_eden_size, - true /* full gc*/, - gc_cause, - heap->collector_policy()); + + // Used for diagnostics + size_policy->clear_generation_free_space_flags(); + + size_policy->compute_generation_free_space(young_live, + eden_live, + old_live, + cur_eden, + max_old_gen_size, + max_eden_size, + true /* full gc*/); + + size_policy->check_gc_overhead_limit(young_live, + eden_live, + max_old_gen_size, + max_eden_size, + true /* full gc*/, + gc_cause, + heap->collector_policy()); + + size_policy->decay_supplemental_growth(true /* full gc*/); heap->resize_old_gen( size_policy->calculated_old_free_size_in_bytes());