If you don't close the connection you'll eventually run the database out of connections. Also an open connection will use memory within the JVM and build up the memory in use. Another thing to do is to avoid using strings, use stringbuffers instead. Try to avoid doing things like this:
String str = "This " + number + " that " + anotherString; If you do this you're creating a number of string objects, and the garbage collector may not reclaim the memory quickly. You can try adjusting the memory that the JVM grabs at startup as well, the arguement is something like -Xmx512M (that would grab 512 megs of ram). One thing to consider, and it works great for me, is to use your servlets and jsp's for access control through the application, but to use some XML/XSLT engine to actually retrieve and format the data coming from the database. I use Oracle's XSQL Servlet, seems to work great and also seems to be less filling (memory filling that is). --mikej -=----- mike jackson [EMAIL PROTECTED] > -----Original Message----- > From: Patrick Codere [mailto:[EMAIL PROTECTED]] > Sent: Monday, August 26, 2002 3:15 PM > To: 'Tomcat Users List' > Subject: OUT OF MEMORY ERROR > > > Hi everyone, > > I have been getting this error for the past few weeks without > solving the issue. But I just found out that I had forgotten to close a > database connection. Could that have been the problem? Time > will tell, but > what exactly happens when you don't close a db connection? > > Thanks for your help. > > Pat > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>