lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jan Philipp Seng" <jp.s...@gmx.de>
Subject Re: how to free memory after index ist build.
Date Wed, 03 Aug 2005 09:26:12 GMT
> : 2) I don't see the code to close your statement, connection, and
> : ResultSet.  Those typically go to a finally block.
> 
> I'm 85% sure that's the memory leak right there... in absence of a
> good memory profiler, have you tried commenting out all of the Lucene
> related code, to make sure that your basic DB Data retrieval code doesn't
> leak memory?
> 
> i'm guessing that without the Lucene code, it won't run out of RAM as fast
> (because their won't be a RAMDirectory index taking up space) but you
> should still see your free memory steadily decrease.

Thank you Hoos,

I left some of my code out to make it compact. There is a finally-block that
does rigth this.
But you are completely rigth. I commented out all Lucene related code and
the free memory decreases every indexing run. I close the connection, but
this does not free the memory. Do you have another hint for me what I can do
against the memory leak in the connector to the mySQL-database? I am using
mysql-connector-java-3.1.10-bin.jar.

Constructor: inits the members:
	Connection conn
  Statement stmt
  ResultSet rs
finally block:
	conn.close();
	conn = null;
  stmt.close();
  stmt = null;
  rs.close();
  rs = null;

Bye for now.

Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message