pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kovács Péter <peter.kovacs@chemaxon.hu>
To: pgsql-jdbc@postgresql.org
Subject: Memory leak or client side caching?
Date: Wed, 11 Jan 2006 14:54:57 +0100
Message-ID: <43C50E31.5040104@chemaxon.hu> (raw)

Hi,

Executing the following code results in an increase of 1GB in memory 
usage by the process.

String sql = "SELECT 
cd_id,cd_fp1,cd_fp2,cd_fp3,cd_fp4,cd_fp5,cd_fp6,cd_fp7,cd_fp8,cd_fp9,cd_fp10,cd_fp11,cd_fp12,cd_fp13,cd_fp14,cd_fp15,cd_fp16,cd_smiles 
FROM editexample1";
PreparedStatement ps = conn.prepareStatement(sql);
try {
	ResultSet rs = ps.executeQuery();
	try {
		while (rs.next()) {
			int cdId = rs.getInt(1);
			for (int i = 0; i < 16; i++) {
				int fp = rs.getInt(i+2);
			}
			String cdSmiles = rs.getString(18);
		}
	} finally {
		rs.close();
	}
} finally {
	ps.close();
}

The result set contains 1 250 000 rows.

I am not sure if this is a memory leak or the driver just caches the 
result set on the client side. If this is the latter, is there a way to 
turn off client side caching? If the former, how should I proceed to 
find the problem?

Thank you!

Peter



view thread (2+ messages)  latest in thread

Message-ID: <43C50E31.5040104@chemaxon.hu>
Permalink:  ../43C50E31.5040104@chemaxon.hu/
Also on:    postgresql.org/message-id/43C50E31.5040104@chemaxon.hu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: peter.kovacs@chemaxon.hu
  Subject: Re: Memory leak or client side caching?
  In-Reply-To: <43C50E31.5040104@chemaxon.hu>
  References: <43C50E31.5040104@chemaxon.hu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox