Created
March 8, 2020 19:01
-
-
Save xolve/dd9659dbae8bc3727e802d4b95699967 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.LinkedList; | |
import java.util.List; | |
public class Main { | |
public static void main(String[] args) { | |
List<byte[]> ls = new LinkedList<>(); | |
try { | |
while (true) { | |
byte[] b = new byte[1024 * 1024]; | |
ls.add(b); | |
} | |
} catch (Throwable t) { | |
System.out.println("Caught OOM, clearing."); | |
ls.clear(); | |
main(args); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment