db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yves pielusenet <yvespieluse...@free.fr>
Subject [MEMORY]Free memory
Date Wed, 31 May 2006 13:56:06 GMT
Hello,
I developpe an application which create several derby databases. It may
be 2 ddatabase or 100. In my application, I have a class which create
those databases and connexions.
Here the constructor method :
-----------------------------------------------------------------------
DBGenConnection(String purl, String pdbname, boolean cancreatedb,
boolean autocommit, String alterTableCreateIndex){
        this.alterTableCreateIndex = alterTableCreateIndex;

        String url = "jdbc:derby:"+purl+pdbname+";create="+cancreatedb;
        url = System.getProperty("db_url", url);

        try{
            String driver = "org.apache.derby.jdbc.EmbeddedDriver";
            String passwd = System.getProperty("db_passwd", "");
            String user = "";
            user = System.getProperty("db_user", user);

            Class.forName(driver);
            // create the conenxion
            con = DriverManager.getConnection(url, user, passwd);
            con.setAutoCommit(false);
        }
        catch(Exception e){
            System.err.println("erreur : "+e);
    }
}
----------------------------------------------------------------------
When I finish to deal with one database, I close it before create the
next one. when I close a database I only do 'myConnection.commit()' and
'myConnection.close()' and that's all.
I run a java memerory profiler and it seems that when I close a databse,
memory is not completly free. 
Is there something to do closing a database to free all memory use by
this database ?

thanks

-- 
yves piel


Mime
View raw message