Skip to content

Instantly share code, notes, and snippets.

@codekrolik
Last active May 19, 2016 19:03
Show Gist options
  • Save codekrolik/e55b8ece07270f40aad85f691696fe6a to your computer and use it in GitHub Desktop.
Save codekrolik/e55b8ece07270f40aad85f691696fe6a to your computer and use it in GitHub Desktop.
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