X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C1C19D88CB for ; Thu, 1 Sep 2005 20:32:24 -0300 (ADT) 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 55841-06 for ; Thu, 1 Sep 2005 23:32:20 +0000 (GMT) Received: from resolution.com (unknown [65.18.201.170]) by svr1.postgresql.org (Postfix) with ESMTP id 27006D8884 for ; Thu, 1 Sep 2005 20:32:19 -0300 (ADT) Received: (from resolutio@localhost) by resolution.com (8.12.10/8.11.2) id j81NWIf9010894; Thu, 1 Sep 2005 19:32:18 -0400 From: gurkan@resolution.com X-Authentication-Warning: resolution.com: resolutio set sender to gurkan@resolution.com using -f To: pgsql-jdbc@postgresql.org Message-ID: <1125617538.43178f82aaebf@www.resolution.com> Date: Thu, 01 Sep 2005 19:32:18 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: IMP/PHP IMAP webmail program 2.2.8 X-Originating-IP: 216.63.139.105 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=1.798 required=5 tests=[FORGED_RCVD_HELO=0.05, MISSING_SUBJECT=1.57, NO_REAL_NAME=0.178] X-Spam-Level: * X-Archive-Number: 200509/6 X-Sequence-Number: 13791 Hi, I have been working on conversion program from Informix to PostgreSQL db, and I have a one table which has large data(bytea). I need to be able to copy this one row (docdata column) that I have which is close to 32MB. Program seems to read the data but cannot copy to postgres (PreparedStatement), it gives OutOfMemoryError. I ran the program with these heap too. java -Xms200m -Xmx700m AddDoc and I do not want to use LargeObject api (I do partion of data based on their dates going from one table to many tables; data seems to be stored at pg_largeobjects tbale). Here is the part of the code, and any help apriciated. How do I copy large data like 32MB or greater? Thanks wbin = informixRs.getBinaryStream("docdata"); while ((wbyte = wbin.read ()) != -1) { wbout.write (wbyte); } outln ("Size of KB is: " + wbout.toByteArray().length/1024); size += wbout.toByteArray().length; inp = new ByteArrayInputStream(wbout.toByteArray()); wbin = null; postgresStmt = postgresConn.prepareStatement("INSERT INTO "+tableName+" (id,docdata) VALUES (?,?)"); postgresStmt.setInt(1,id); if(docdef_id.compareTo("12720") == 0 ) { outln("\n\nbefore out of memory"); postgresStmt.setBinaryStream (2, inp, inp.available()); outln("\n\nafter out of memory");//cannot reach here } else { postgresStmt.setBinaryStream (2, inp, inp.available()); } ------------------------------------------------- This mail sent through IMP: www.resolution.com