Created
December 17, 2018 21:15
-
-
Save nikoncode/f6d8a8e4912126b6b4a8e443bf1aa5f8 to your computer and use it in GitHub Desktop.
Metaspace OOM
This file contains hidden or 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.net.MalformedURLException; | |
| import java.net.URL; | |
| import java.net.URLClassLoader; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class Class1 { | |
| public static void main(String[] args) throws MalformedURLException, ClassNotFoundException { | |
| final List<Class<?>> classes = new ArrayList<>(); | |
| while (true) { | |
| classes.add(new URLClassLoader( | |
| new URL[]{ | |
| new URL("http://central.maven.org/maven2/com/google/guava/guava/27.0.1-jre/guava-27.0.1-jre.jar") | |
| }).loadClass("com.google.common.base.Optional")); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment