1 30 31 32 package org.hsqldb.test; 33 34 import java.sql.Timestamp ; 35 36 import org.hsqldb.lib.StopWatch; 37 38 public class TestObjectSize { 39 40 public TestObjectSize() { 41 42 StopWatch sw = new StopWatch(); 43 int testCount = 2350000; 44 45 System.out.println("Fill Memory with Objects "); 46 47 Object [] objectArray = new Object [testCount]; 48 49 for (int j = 0; j < objectArray.length; j++) { 50 objectArray[j] = new Timestamp (0); 51 } 52 53 System.out.println("Array Filled " + sw.elapsedTime()); 54 55 for (int j = 0; j < objectArray.length; j++) { 56 objectArray[j] = null; 57 } 58 59 Object [] objectArray2 = new Object [testCount]; 60 Object [] objectArray3 = new Object [testCount]; 61 Object [] objectArray4 = new Object [testCount]; 62 Object [] objectArray5 = new Object [testCount]; 63 Object [] objectArray6 = new Object [testCount]; 64 65 short[] shortArray = new short[testCount]; 67 byte[] byteArray = new byte[testCount]; 68 69 System.out.println("Fill with Empty Arrays " + sw.elapsedTime()); 70 sw.zero(); 71 } 72 73 public static void main(String [] argv) { 74 TestObjectSize ls = new TestObjectSize(); 75 } 76 } 77 | Popular Tags |