Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp @ 4091:d06a2d7fcd5b
7110718: -XX:MarkSweepAlwaysCompactCount=0 crashes the JVM
Summary: Interpret MarkSweepAlwaysCompactCount < 1 as never do full compaction
Reviewed-by: ysr, tonyp, jmasa, johnc
author | brutisso |
---|---|
date | Mon, 21 Nov 2011 07:47:34 +0100 |
parents | f95d63e2154a |
children | da91efe96a93 |
comparison
equal
deleted
inserted
replaced
4090:a88de71c4e3a | 4091:d06a2d7fcd5b |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. | 2 * Copyright (c) 2001, 2011, 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. |
94 * we don't start compacting before there is a significant gain to be made. | 94 * we don't start compacting before there is a significant gain to be made. |
95 * Occasionally, we want to ensure a full compaction, which is determined | 95 * Occasionally, we want to ensure a full compaction, which is determined |
96 * by the MarkSweepAlwaysCompactCount parameter. This is a significant | 96 * by the MarkSweepAlwaysCompactCount parameter. This is a significant |
97 * performance improvement! | 97 * performance improvement! |
98 */ | 98 */ |
99 bool skip_dead = ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); | 99 bool skip_dead = (MarkSweepAlwaysCompactCount < 1) |
100 || ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); | |
100 | 101 |
101 size_t allowed_deadspace = 0; | 102 size_t allowed_deadspace = 0; |
102 if (skip_dead) { | 103 if (skip_dead) { |
103 const size_t ratio = allowed_dead_ratio(); | 104 const size_t ratio = allowed_dead_ratio(); |
104 allowed_deadspace = space()->capacity_in_words() * ratio / 100; | 105 allowed_deadspace = space()->capacity_in_words() * ratio / 100; |