possible memory leak??
От | Dave Cramer |
---|---|
Тема | possible memory leak?? |
Дата | |
Msg-id | 1036761105.12348.10.camel@inspiron.cramers обсуждение исходный текст |
Ответ на | DatabaseMetaData.getTables problem (snpe <snpe@snpe.co.yu>) |
Ответы |
Re: possible memory leak??
|
Список | pgsql-jdbc |
If I run the following program for an extended period of time the memory consumed by java keeps increasing 4M at a time. Can anyone else confirm this, and next; can anyone explain why? Is this normal? I doubt it, but can't confirm it? Does anyone have access to an optimizer to run this on? -- Dave Cramer <Dave@micro-automation.net> import java.lang.Runnable; /** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */ public class TestRoutes implements Runnable { Connection con; public TestRoutes() { try { Class.forName("org.postgresql.Driver"); con = DriverManager.getConnection("jdbc:postgresql://localhost/symcor", "davec", "" ); } catch ( Exception ex) { ex.printStackTrace(); } } public void selectRoutes() { Statement stmt = null; ResultSet rs = null; try { stmt = con.createStatement(); rs = stmt.executeQuery("select * from route"); for( int i=0; rs.next(); i++ ) { System.out.println( "Route " + i ); } } catch ( Exception ex ) { ex.printStackTrace(); } finally { try { rs.close(); stmt.close(); rs=null; stmt=null; } catch (SQLException ex) { } } } public void run() { while(true) { try { //RouteModel.getAllRoutes(); selectRoutes(); Thread.sleep(2000); } catch( Exception ex ) { return; } } } public static void main( String [] args ) { TestRoutes t = new TestRoutes(); new Thread(t).start(); } }
В списке pgsql-jdbc по дате отправления: