Last active
May 19, 2016 19:03
-
-
Save codekrolik/e55b8ece07270f40aad85f691696fe6a to your computer and use it in GitHub Desktop.
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 io.netty.buffer.PooledByteBufAllocator; | |
import io.netty.util.ResourceLeakDetector; | |
import io.netty.util.ResourceLeakDetector.Level; | |
import org.junit.Test; | |
public class NettyTest { | |
public static PooledByteBufAllocator alloc = new PooledByteBufAllocator(true); | |
@Test | |
public void test() throws InterruptedException { | |
ResourceLeakDetector.setLevel(Level.PARANOID); | |
for (int j = 0; j < 100; j++) { | |
System.out.println(j); | |
for (int i = 0; i < 50000; i++) { | |
alloc.buffer(1000, 1000); | |
} | |
Thread.sleep(10); | |
System.gc(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment