Mercurial > hg > truffle
comparison 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 |
comparison
equal
deleted
inserted
replaced
10287:12f651e29f6b | 10288:eba99d16dc6f |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * | 4 * |
5 * This code is free software; you can redistribute it and/or modify it | 5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as | 6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
2082 // Calculate optimal free space amounts | 2082 // Calculate optimal free space amounts |
2083 assert(young_gen->max_size() > | 2083 assert(young_gen->max_size() > |
2084 young_gen->from_space()->capacity_in_bytes() + | 2084 young_gen->from_space()->capacity_in_bytes() + |
2085 young_gen->to_space()->capacity_in_bytes(), | 2085 young_gen->to_space()->capacity_in_bytes(), |
2086 "Sizes of space in young gen are out-of-bounds"); | 2086 "Sizes of space in young gen are out-of-bounds"); |
2087 | |
2088 size_t young_live = young_gen->used_in_bytes(); | |
2089 size_t eden_live = young_gen->eden_space()->used_in_bytes(); | |
2090 size_t old_live = old_gen->used_in_bytes(); | |
2091 size_t cur_eden = young_gen->eden_space()->capacity_in_bytes(); | |
2092 size_t max_old_gen_size = old_gen->max_gen_size(); | |
2087 size_t max_eden_size = young_gen->max_size() - | 2093 size_t max_eden_size = young_gen->max_size() - |
2088 young_gen->from_space()->capacity_in_bytes() - | 2094 young_gen->from_space()->capacity_in_bytes() - |
2089 young_gen->to_space()->capacity_in_bytes(); | 2095 young_gen->to_space()->capacity_in_bytes(); |
2090 size_policy->compute_generation_free_space( | 2096 |
2091 young_gen->used_in_bytes(), | 2097 // Used for diagnostics |
2092 young_gen->eden_space()->used_in_bytes(), | 2098 size_policy->clear_generation_free_space_flags(); |
2093 old_gen->used_in_bytes(), | 2099 |
2094 young_gen->eden_space()->capacity_in_bytes(), | 2100 size_policy->compute_generation_free_space(young_live, |
2095 old_gen->max_gen_size(), | 2101 eden_live, |
2096 max_eden_size, | 2102 old_live, |
2097 true /* full gc*/, | 2103 cur_eden, |
2098 gc_cause, | 2104 max_old_gen_size, |
2099 heap->collector_policy()); | 2105 max_eden_size, |
2106 true /* full gc*/); | |
2107 | |
2108 size_policy->check_gc_overhead_limit(young_live, | |
2109 eden_live, | |
2110 max_old_gen_size, | |
2111 max_eden_size, | |
2112 true /* full gc*/, | |
2113 gc_cause, | |
2114 heap->collector_policy()); | |
2115 | |
2116 size_policy->decay_supplemental_growth(true /* full gc*/); | |
2100 | 2117 |
2101 heap->resize_old_gen( | 2118 heap->resize_old_gen( |
2102 size_policy->calculated_old_free_size_in_bytes()); | 2119 size_policy->calculated_old_free_size_in_bytes()); |
2103 | 2120 |
2104 // Don't resize the young generation at an major collection. A | 2121 // Don't resize the young generation at an major collection. A |