Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 93aca5f

Browse files
Olga MikhaltsovaYuri Nesterenko
authored andcommitted
8245801: StressRecompilation triggers assert "redundunt OSR recompilation detected. memory leak in CodeCache!"
Assert is too strong. Backport-of: 76ac621
1 parent f9a04a4 commit 93aca5f

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

src/hotspot/share/oops/instanceKlass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2995,9 +2995,9 @@ void InstanceKlass::adjust_default_methods(bool* trace_name_printed) {
29952995
void InstanceKlass::add_osr_nmethod(nmethod* n) {
29962996
#ifndef PRODUCT
29972997
if (TieredCompilation) {
2998-
nmethod * prev = lookup_osr_nmethod(n->method(), n->osr_entry_bci(), n->comp_level(), true);
2999-
assert(prev == NULL || !prev->is_in_use(),
3000-
"redundunt OSR recompilation detected. memory leak in CodeCache!");
2998+
nmethod* prev = lookup_osr_nmethod(n->method(), n->osr_entry_bci(), n->comp_level(), true);
2999+
assert(prev == NULL || !prev->is_in_use() || StressRecompilation,
3000+
"redundant OSR recompilation detected. memory leak in CodeCache!");
30013001
}
30023002
#endif
30033003
// only one compilation can be active
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
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
7+
* published by the Free Software Foundation.
8+
*
9+
* This code is distributed in the hope that it will be useful, but WITHOUT
10+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
* version 2 for more details (a copy is included in the LICENSE file that
13+
* accompanied this code).
14+
*
15+
* You should have received a copy of the GNU General Public License version
16+
* 2 along with this work; if not, write to the Free Software Foundation,
17+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18+
*
19+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20+
* or visit www.oracle.com if you need additional information or have any
21+
* questions.
22+
*/
23+
24+
/*
25+
* @test
26+
* @bug 8245801
27+
* @requires vm.debug
28+
* @summary Test running with StressRecompilation enabled.
29+
* @run main/othervm -Xcomp -XX:+IgnoreUnrecognizedVMOptions -XX:+StressRecompilation
30+
* compiler.c2.TestStressRecompilation
31+
*/
32+
33+
package compiler.c2;
34+
35+
public class TestStressRecompilation {
36+
37+
public static void main(String[] args) {
38+
System.out.println("Test passed.");
39+
}
40+
}

0 commit comments

Comments
 (0)