diff options
Diffstat (limited to 'test/jake2/render/DisposeBuffer.java')
-rw-r--r-- | test/jake2/render/DisposeBuffer.java | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/test/jake2/render/DisposeBuffer.java b/test/jake2/render/DisposeBuffer.java deleted file mode 100644 index d17157c..0000000 --- a/test/jake2/render/DisposeBuffer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Created on May 13, 2005 - * - */ -package jake2.render; - -import java.nio.Buffer; -import java.nio.ByteBuffer; - -/** - * @author cwei - * - */ -public class DisposeBuffer { - - // 160 MB direct buffers - static int SIZE = 1024 * 1024; - static int COUNT = 160; - - public static void main(String[] args) { - System.out.println("DirectBuffer allocation."); - Buffer[] buf = new Buffer[COUNT]; - Runtime run = Runtime.getRuntime(); - System.gc(); - for (int i = 0; i < COUNT; i++) { - buf[i] = ByteBuffer.allocateDirect(SIZE); - } - System.gc(); - System.out.println((run.totalMemory() / 1024) + "KB heap"); - try { - Thread.sleep(10000); - } catch (InterruptedException e) { - } - System.out.println("DirectBuffer dispose."); - for (int i = 0; i < COUNT; i++) { - buf[i] = null; - } - System.gc(); - System.out.println((run.totalMemory() / 1024) + "KB heap"); - try { - Thread.sleep(20000); - } catch (InterruptedException e) { - } - } -} |