Skip site navigation (1) Skip section navigation (2)

Re: Major Memory Leak in PostgreSQL JDBC Driver

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: Gerald Gutierrez <gutz(at)kalador(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Major Memory Leak in PostgreSQL JDBC Driver
Date: 2001-04-17 13:19:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Quoting Gerald Gutierrez <gutz(at)kalador(dot)com>:

> At least the 7.1 RC3 driver has a memory leak in that the
> .../jdbc2/ class uses Java's ThreadLocal object
> for
> "optimization" reasons. However, Sun's J2SE 1.3 leaks memory whenever
> this
> class is used. Hence, repeated use of the JDBC driver's
> PreparedStatement
> class will cause a major memory leak.

This has already been reported (and there now exists a bug registered with Sun).

As soon as I can I'm going to remove the need for ThreadLocal from the driver.

> that it doesn't have to be instantiated each time (this is the
> optimization), just instantiate the SimpleDateFormat class each time.
> We've
> noticed no performance loss and our application no longer has any
> memory
> leaks.

There was some discussion about this some time ago, and the concensus then was 
to limit the number of instanciated SimpleDateFormat's to a minimum.

> Please consider fixing this problem before releasing 7.1.

It should be (assuming I get some spare time between now and then - ie why I'm 
a week behind on emails).


Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver:
RetepPDF PDF library for Java:

In response to

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2001-04-17 13:26:31
Subject: What's wrong with glibc-devel-2.2
Previous:From: pgsql-bugsDate: 2001-04-17 11:40:02
Subject: JDBC setObject(n,obj) throws exception when obj is null

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group