My application ran fine all this time. We have a upadte by our operations team and i see that Oracle JDBC driver(11.2.0.3) was updated and the JDK was updated to 1.6.30.
I have been reading all blogs and have checked for any missed connections that were not closed, but none of these have solved my problem. I see that the memory allocated once the methods run are not freed up once the processing is completed.
I have added finally blocks to all methods where i am querying
} finally {
try {
if (results != null) {
results.close();
results = null;
}
} catch (Exception e) { resources.logException(this.getClass().getName(), e);}
try{
if (statement != null) {
statement.close();
statement = null;
}
} catch (Exception e) { resources.logException(this.getClass().getName(), e); }
try{
if (connection != null) {
resources.free(connection);
connection.close();
connection=null;
}
} catch (Exception e) { resources.logException(this.getClass().getName(), e); }
}
My application runs fine for couple hours and then throws OutofMemory - Java Heap size. I also ran core dump and heap dump - I analyzed the HPROF file - I see this as a suspect
5,832 instances of "oracle.jdbc.driver.T4CConnection", loaded by "sun.misc.Launcher$AppClassLoader @ 0x96fe0a10" occupy 348,070,864 (67.53%) bytes. These instances are referenced from one instance of "java.util.WeakHashMap$Entry[]", loaded by ""
Please let me know if there is anything i am missing.
I also changed the -XMX to 1024 and it still no changes (was set at 256)