Mercurial > hg > graal-jvmci-8
comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp @ 10287:12f651e29f6b
6843347: Boundary values in some public GC options cause crashes
Summary: Setting some public integer options to specific values causes crashes or undefined GC behavior. This patchset adds the necessary argument checking for these options.
Reviewed-by: jmasa, brutisso
author | tschatzl |
---|---|
date | Wed, 15 May 2013 11:05:09 +0200 |
parents | b735136e0d82 |
children | de6a9e811145 |
comparison
equal
deleted
inserted
replaced
10286:0a2986f36965 | 10287:12f651e29f6b |
---|---|
86 * we don't start compacting before there is a significant gain to be made. | 86 * we don't start compacting before there is a significant gain to be made. |
87 * Occasionally, we want to ensure a full compaction, which is determined | 87 * Occasionally, we want to ensure a full compaction, which is determined |
88 * by the MarkSweepAlwaysCompactCount parameter. This is a significant | 88 * by the MarkSweepAlwaysCompactCount parameter. This is a significant |
89 * performance improvement! | 89 * performance improvement! |
90 */ | 90 */ |
91 bool skip_dead = (MarkSweepAlwaysCompactCount < 1) | 91 bool skip_dead = ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); |
92 || ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); | |
93 | 92 |
94 size_t allowed_deadspace = 0; | 93 size_t allowed_deadspace = 0; |
95 if (skip_dead) { | 94 if (skip_dead) { |
96 const size_t ratio = allowed_dead_ratio(); | 95 const size_t ratio = allowed_dead_ratio(); |
97 allowed_deadspace = space()->capacity_in_words() * ratio / 100; | 96 allowed_deadspace = space()->capacity_in_words() * ratio / 100; |