mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-28 15:51:02 +00:00
8282314: nsk/jvmti/SuspendThread/suspendthrd003 may leak memory
Reviewed-by: dholmes, cjplummer, amenkov, lmesnik, mseledtsov
This commit is contained in:
parent
f5217b475e
commit
bb7ee5a04a
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -88,6 +88,9 @@ public class suspendthrd003 extends DebugeeClass {
|
||||
int res = -1;
|
||||
long start_time = System.currentTimeMillis();
|
||||
while (System.currentTimeMillis() < start_time + (timeMax * 1000)) {
|
||||
// Start each loop with a clear log buffer so we only
|
||||
// track the run that can potentially fail:
|
||||
log.clearLogBuffer();
|
||||
count++;
|
||||
|
||||
// Original suspendthrd001 test block starts here:
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -477,6 +477,13 @@ public class Log extends FinalizableObject {
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Clear all messages from log buffer.
|
||||
*/
|
||||
public synchronized void clearLogBuffer() {
|
||||
logBuffer.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print all messages from log buffer which were hidden because
|
||||
* of non-verbose mode,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user