Mon, 21 Nov 2011 07:47:34 +0100
7110718: -XX:MarkSweepAlwaysCompactCount=0 crashes the JVM
Summary: Interpret MarkSweepAlwaysCompactCount < 1 as never do full compaction
Reviewed-by: ysr, tonyp, jmasa, johnc
src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/memory/space.hpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp Fri Nov 18 12:52:27 2011 -0500 1.2 +++ b/src/share/vm/gc_implementation/parallelScavenge/psMarkSweepDecorator.cpp Mon Nov 21 07:47:34 2011 +0100 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -96,7 +96,8 @@ 1.11 * by the MarkSweepAlwaysCompactCount parameter. This is a significant 1.12 * performance improvement! 1.13 */ 1.14 - bool skip_dead = ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); 1.15 + bool skip_dead = (MarkSweepAlwaysCompactCount < 1) 1.16 + || ((PSMarkSweep::total_invocations() % MarkSweepAlwaysCompactCount) != 0); 1.17 1.18 size_t allowed_deadspace = 0; 1.19 if (skip_dead) {
2.1 --- a/src/share/vm/memory/space.hpp Fri Nov 18 12:52:27 2011 -0500 2.2 +++ b/src/share/vm/memory/space.hpp Mon Nov 21 07:47:34 2011 +0100 2.3 @@ -1,5 +1,5 @@ 2.4 /* 2.5 - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. 2.6 + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 2.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2.8 * 2.9 * This code is free software; you can redistribute it and/or modify it 2.10 @@ -533,7 +533,8 @@ 2.11 * by the MarkSweepAlwaysCompactCount parameter. \ 2.12 */ \ 2.13 int invocations = SharedHeap::heap()->perm_gen()->stat_record()->invocations;\ 2.14 - bool skip_dead = ((invocations % MarkSweepAlwaysCompactCount) != 0); \ 2.15 + bool skip_dead = (MarkSweepAlwaysCompactCount < 1) \ 2.16 + ||((invocations % MarkSweepAlwaysCompactCount) != 0); \ 2.17 \ 2.18 size_t allowed_deadspace = 0; \ 2.19 if (skip_dead) { \