-
Bug
-
Resolution: Fixed
-
P2
-
14, 15, 16
-
b31
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8258478 | 17 | Erik Gahlin | P2 | Resolved | Fixed | b02 |
JDK-8260098 | 16.0.1 | Erik Gahlin | P2 | Resolved | Fixed | b03 |
From mailing list. The following code provokes a memory leak:
import jdk.jfr.consumer.RecordingStream;
public class RecordingStreamTest {
public static byte[] bytes;
public static void main(String[] args) throws Exception {
RecordingStream stream = new RecordingStream();
stream.enable("jdk.ObjectAllocationInNewTLAB");
stream.enable("jdk.ObjectAllocationOutsideTLAB");
stream.onEvent(re -> {});
stream.startAsync();
for (int j = 1; j <= 5; j++) {
for (int i = 1; i <= 100_000_000; i++) {
bytes = new byte[1024];
}
System.gc();
}
stream.close();
stream.awaitTermination();
System.gc();
Thread.sleep(5000);
}
}
import jdk.jfr.consumer.RecordingStream;
public class RecordingStreamTest {
public static byte[] bytes;
public static void main(String[] args) throws Exception {
RecordingStream stream = new RecordingStream();
stream.enable("jdk.ObjectAllocationInNewTLAB");
stream.enable("jdk.ObjectAllocationOutsideTLAB");
stream.onEvent(re -> {});
stream.startAsync();
for (int j = 1; j <= 5; j++) {
for (int i = 1; i <= 100_000_000; i++) {
bytes = new byte[1024];
}
System.gc();
}
stream.close();
stream.awaitTermination();
System.gc();
Thread.sleep(5000);
}
}
- backported by
-
JDK-8258478 JFR: RecordingStream leaks memory
- Resolved
-
JDK-8260098 JFR: RecordingStream leaks memory
- Resolved
- links to
-
Commit openjdk/jdk16/bbc2e951
-
Commit openjdk/jdk/3c664850
-
Review openjdk/jdk16/81
-
Review openjdk/jdk/1774
(1 links to)