pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: pgsql-jdbc@postgresql.org
Subject: Re: JDBC driver inserting into a table with Bytea type get
Date: Mon, 21 Jun 2004 17:50:25 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0406211749470.9504@leary.csoft.net> (raw)


On Mon, 21 Jun 2004, Sailer, Denis (YBUSA-CDR) wrote:

> I did not mean to imply that we are loading blobs that are 1GB in size.  We
> can't even get one loaded that is 1.5 MB, even when we specify jvm size of 1
> GB.  Yeah that's gigabytes.  If this thing was working correctly there
> wouldn't be any need for the posts that we've seen and 1GB jvm size would
> certainly handle a blob of 1.5MB

I didn't realize how bad this was until I tried using the attached test 
program.  With the default settings the driver can't load a 2MB byte 
array, but I don't agree with your claims of increasing jvm size not 
helping.  With -Xmx128M I was able to load the 2MB array, but not 3MB 
which is pretty scary (128 MB can't load 3MB of data?).  With the patched 
version of the driver and default memory settings I was able to load a 
25MB array before I started to swap badly as the postgresql backend was 
taking up a fair amount of memory in addition to the other things I've got 
running.

Getting this patch applied has jumped up many notches on my todo list 
because of this.

Kris Jurka

Attachments:

BinStream.java (text/plain, 766B) download import java.sql.*; import java.io.*; public class BinStream { public static void main(String args[]) throws Exception { Class.forName("org.postgresql.Driver"); Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5750/jurka","jurka",""); int sizes[] = {1,2,3,4,5,6,7,8,9,10}; Statement stmt = conn.createStatement(); stmt.execute("CREATE TEMP TABLE bytes(a bytea)"); stmt.close(); for (int i=0; i<sizes.length; i++) { System.err.println("Testing with "+ sizes[i]); PreparedStatement pstmt = conn.prepareStatement("INSERT INTO bytes(a) VALUES (?)"); byte arr[] = new byte[sizes[i]*1000000]; pstmt.setBytes(1,arr); pstmt.executeUpdate(); pstmt.close(); } conn.close(); } }

view thread (6+ messages)

Message-ID: <Pine.BSO.4.56.0406211749470.9504@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0406211749470.9504@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0406211749470.9504@leary.csoft.net

 · 

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: books@ejurka.com
  Subject: Re: JDBC driver inserting into a table with Bytea type get
  In-Reply-To: <Pine.BSO.4.56.0406211749470.9504@leary.csoft.net>
  References: <Pine.BSO.4.56.0406211749470.9504@leary.csoft.net>

* 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