public void testMemory() throws SQLException, IOException, InterruptedException { super.ucanaccess.setAutoCommit(false); Statement st = null; try { st = super.ucanaccess.createStatement(); System.out.println("total memory 0=" + Runtime.getRuntime().totalMemory()); System.out.println("free memory 0=" + Runtime.getRuntime().freeMemory()); for (int i = 0; i <= 100000; i++) st.execute( "INSERT INTO memm(id,a,c,d) VALUES (" + i + ",'33','booddddddddddddddddddddddddddddddo','dddddddddddddddddsssssssssssssssdddd' )"); super.ucanaccess.commit(); super.ucanaccess.close(); super.ucanaccess = null; long occ = Runtime.getRuntime().freeMemory(); System.out.println("total memory 1=" + Runtime.getRuntime().totalMemory()); System.out.println("free memory 1=" + occ); Thread.sleep(61000); System.out.println("total memory 2=" + Runtime.getRuntime().totalMemory()); System.out.println("free memory 2=" + Runtime.getRuntime().freeMemory()); System.out.println("free memory diff =" + (Runtime.getRuntime().freeMemory() - occ)); // super.ucanaccess=super.getUcanaccessConnection(); super.ucanaccess = super.getUcanaccessConnection(); dump("select * from memm limit 10"); // for (int i=0;i<3;i++){ // Thread.sleep(60000); // super.ucanaccess=super.getUcanaccessConnection(); // // dump("select * from memm"); // super.ucanaccess.close(); // } } finally { if (st != null) st.close(); } }
protected void setUp() throws Exception { super.setUp(); executeCreateTable("CREATE TABLE Talias (id LONG,descr memo) "); }
protected void setUp() throws Exception { setInactivityTimeout(1); super.setUp(); executeCreateTable("CREATE TABLE memm( id LONG PRIMARY KEY,A LONG , C TEXT,D TEXT) "); }