[BAEL-7323] JFR EXAMPLE (#15650)
Co-authored-by: Bhaskar <bhaskar.dastidar@freshworks.com>
This commit is contained in:
parent
900ff584fe
commit
238e5fb473
@ -0,0 +1,21 @@
|
|||||||
|
package com.baeldung.jfrview;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class JFRExample {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
JFRExample se = new JFRExample();
|
||||||
|
se.insertToList(new ArrayList<>());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void insertToList(List<Object> list) {
|
||||||
|
try {
|
||||||
|
while (true) {
|
||||||
|
list.add(new Object());
|
||||||
|
}
|
||||||
|
} catch (OutOfMemoryError e) {
|
||||||
|
System.out.println("Out of Memory. Exiting");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user