Subject | Memory Leak |
---|---|
Author | iananewby |
Post date | 2002-04-10T09:39:54Z |
Hi All,
Just to let you all know that I have fixed the problem I had with
the database process growing massively. It was a problem with my
Java code. Below is a code snippet of how I was accessing the
database.
ResultSet rs;
Connection con = null;
con = pm1.getConnection("Intelus");
rs = con.createStatement().executeQuery("select * from users");
rs.close();
con.commit();
pm1.freeConnection("Intelus",con);
I have found that if I add a
rs.getStatement().close();
before the rs.close() the memory doesn't increase any more. I guess
that Interserver isn't closing the statements properly when they are
garbage collected.
The problem was worse because of the connection pool. If I closed
the connection, the memory growth stopped.
Thanks for all your suggestions!
Regards
Ian Newby
Just to let you all know that I have fixed the problem I had with
the database process growing massively. It was a problem with my
Java code. Below is a code snippet of how I was accessing the
database.
ResultSet rs;
Connection con = null;
con = pm1.getConnection("Intelus");
rs = con.createStatement().executeQuery("select * from users");
rs.close();
con.commit();
pm1.freeConnection("Intelus",con);
I have found that if I add a
rs.getStatement().close();
before the rs.close() the memory doesn't increase any more. I guess
that Interserver isn't closing the statements properly when they are
garbage collected.
The problem was worse because of the connection pool. If I closed
the connection, the memory growth stopped.
Thanks for all your suggestions!
Regards
Ian Newby