HostIgnition
knowledgebase
Back to HostIgnition Request New Article Contact Us

Member Login

  Main Page >>  JSP & Java Servlets >>  java.sql.Connection Memory Leak

java.sql.Connection Memory Leak
This has been detected by 1 of our client, which causes OutOfMemory Error. If you have code that handles connection directly and has OutOfMemory Problem, you could try the following:


Runtime r = Runtime.getRuntime();
if (r.maxMemory() - r.totalMemory() + r.freeMemory() < 10000000l) {
con = null;
try {
con = DriverManager.getConnection(PATH);
}
catch (SQLException e) {
e.printStackTrace();
}
}

Got Questions? Need Assistance?
Submit a Support Ticket
Login and submit a support ticket to have our technical support assist you:

Username:

Password:

Copyright (c) 2008 HostIgnition
 
Virtual Web Hosting | Dedicated Servers | Resellers | About Us | Contact Us