Created
August 26, 2011 04:46
-
-
Save sergiolopes/1172716 to your computer and use it in GitHub Desktop.
Como causar um memory leak no Tomcat
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
// opcao1: ThreadLocal | |
new ThreadLocal<Object>().set(new Object(){}); | |
// opcao2: Logger | |
Level customLevel = new Level("Meu Nivel Customizado", 555) {}; | |
Logger.getLogger("teste").log(customLevel, "Log inocente"); | |
// opcao3: Runtime | |
Runtime.getRuntime().addShutdownHook(new Thread() {}); | |
// opcao4: setProperties | |
System.setProperties(new Properties(){}); | |
// opcao5: setOut | |
System.setOut(new PrintStream(System.out){ | |
public void println(String x) { | |
super.println("MENSAGEM: " + x); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment