X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 4112932A296 for ; Tue, 5 Oct 2004 00:17:17 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 94570-09 for ; Mon, 4 Oct 2004 23:17:11 +0000 (GMT) Received: from rwcrmhc12.comcast.net (rwcrmhc12.comcast.net [216.148.227.85]) by svr1.postgresql.org (Postfix) with ESMTP id 8E78532A28E for ; Tue, 5 Oct 2004 00:17:10 +0100 (BST) Received: from [192.168.1.52] (dtenny.ne.client2.attbi.com[24.60.112.224]) by comcast.net (rwcrmhc12) with ESMTP id <2004100423170501400s1asre>; Mon, 4 Oct 2004 23:17:09 +0000 Message-ID: <4161D9EF.9030202@comcast.net> Date: Mon, 04 Oct 2004 19:17:03 -0400 From: Jeffrey Tenny User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616 X-Accept-Language: en-us, en MIME-Version: 1.0 To: postgres jdbc Subject: ResultSet.getBinaryStream nothing more than a ResultSet.getBytes() call? Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/5 X-Sequence-Number: 11110 I've been working to minimize the memory footprint of my application. I was under the impression that ResultSet.getBinaryStream would be more efficient than getBytes(). Certainly the documented semantics imply that that is a goal (since you must process the InputStream from getBinaryStream before the call to ResultSet.next() or even processing the next column. But the following trace from a java heap profile suggests that we're still just copying the bytes from the resultset as with getBytes() instead of streaming the ones already in memory, though perhaps it's because I'm using a read(buf) call on the stream. Anybody got an authoritative answer? Or if you point me at a 8.0DEV driver tarball I'll look myself, but I don't run CVS and couldn't find a tarball on gborg. TRACE 18107: org.postgresql.util.PGbytea.toBytes(PGbytea.java:29) org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBytes(AbstractJdbc2ResultSet.java:1986) org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBinaryStream(AbstractJdbc2ResultSet.java:2115) org.apache.commons.dbcp.DelegatingResultSet.getBinaryStream(DelegatingResultSet.java:221) Thanks...