W3C home > Mailing lists > Public > www-jigsaw@w3.org > May to June 1999

Re: servlet writing to database memory(?) problem

From: Yves Lafon <ylafon@w3.org>
Date: Fri, 21 May 1999 17:47:53 +0200 (MET DST)
To: Fiona Cameron <f.cameron@ulst.ac.uk>
cc: www-jigsaw@w3.org
Message-ID: <Pine.GSO.4.10.9905211743100.26818-100000@tarantula.inria.fr>
On Fri, 21 May 1999, Fiona Cameron wrote:

> Hi,
> 
> I have a servlet running on Jigsaw that collects data and writes it 
> to an MS Access database on the same system, using JDBC. The data is 
> about 100 records.  
> 
> For the first 4 or 5 runs of the program performance is ok - a couple 
> of  seconds to write all the records.  However, after this the 
> program slows right down and can take around 10 minutes to perform 
> the same function.  
> 
> No particular data or sequence of data appears to be associated with 
> the problem.   If I stop Jigsaw and start it again, the problem 
> clears for a while, then recurs.  Jigsaw is not giving me any error 
> messages.  
> 
> My servlet opens the database connection at the beginning and closes 
> it at the end, but could it be that Jigsaw is holding on to old 
> connections to the database and thus causing a memory problem?  

Jigsawhas nothing to do with what your servlet is doing, you just have to
free what is needed in your code, so that the garbage collection is able
to do its job.
As the servlet is kept alive by Jigsaw, you code has to be thread safe and
it must take care of potential leaks (memory and file descriptors).
You may try to check if the jdbc drivers you are using are not doing bad
things (jdk_1.2.1_pre_03 for solaris has an heap analyzer tool which may
be useful), as this is also part of the code that may cause this kind of
problem.

> Has anyone else had similar problems?
> 
> I'd be very grateful for any ideas.

Hope this helps,

      /\          - Yves Lafon - World Wide Web Consortium - 
  /\ /  \        Architecture Domain - Jigsaw Activity Leader
 /  \    \/\    
/    \   /  \   http://www.w3.org/People/Lafon - ylafon@w3.org    
Received on Friday, 21 May 1999 11:47:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 9 April 2012 12:13:29 GMT