X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 123EB9F9858 for ; Thu, 24 Aug 2006 14:25:52 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 97496-06 for ; Thu, 24 Aug 2006 17:25:36 +0000 (UTC) X-Greylist: delayed 00:15:46.362391 by SQLgrey- Received: from l0isi08.larcb.ecs.nasa.gov (l0isi08u.ecs.nasa.gov [129.165.226.2]) by postgresql.org (Postfix) with ESMTP id 00C819F931A for ; Thu, 24 Aug 2006 14:25:35 -0300 (ADT) Received: (from hermes@localhost) by l0isi08.larcb.ecs.nasa.gov (AIX5.3/8.11.6p2/8.11.0) id k7OHDwC1142878 for ; Thu, 24 Aug 2006 13:13:58 -0400 X-Authentication-Warning: l0isi08.larcb.ecs.nasa.gov: hermes set sender to using -f Received: by larcb.ecs.nasa.gov via smwrap Version 5.1.5 id smwrapET7gEa; Thu Aug 24 13:13:22 2006 Message-ID: <44EDDD23.2040605@larcb.ecs.nasa.gov> Date: Thu, 24 Aug 2006 13:08:51 -0400 From: Jim Davis User-Agent: Mozilla Thunderbird 1.0.8-1.1.fc4 (X11/20060501) MIME-Version: 1.0 To: Subject: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=3.817 tagged_above=0 required=5 tests=SPF_HELO_SOFTFAIL, SPF_SOFTFAIL, UNPARSEABLE_RELAY X-Spam-Level: *** X-Archive-Number: 200608/124 X-Sequence-Number: 15651 I am not a java programmer, so it is possible I am doing something wrong: I saw this problem initially on my test system using sequoia jdbc driver with my postgresql 8.1.4 database servers trying to create an index on a 27 million row table. After many suggestions and tests, It was suggested I try using the postgresql jdbc driver to perform the create index to try and isolate where the out of memory condition is occurring. So I edited a java application I was testing with and pointed it to the postgresql jdbc driver. I used version postgresql-.2dev-503.jdbc3.jar the first time and postgresql-9.2dev-503.jdbc3.jar the second time with the same results: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space Below is the java code I am using to try to do this: ** * */ import java.sql.*; /** * @author jdavis * */ public class jdbcpostgrestestcreateindex { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub String url = "jdbc:postgresql://10.10.101.14:3153/ange"; Connection con; try { Class.forName("org.postgresql.Driver"); } catch(java.lang.ClassNotFoundException e) { System.err.print("ClassNotFoundException: "); System.err.println(e.getMessage()); } try { con = DriverManager.getConnection(url,"user","XXXXXXX"); con.setAutoCommit(false); Statement s = con.createStatement(); s.setCursorName("cursor name"); s.setFetchSize(100); String createTableIndexString = "create index file_name_idx on catalog using btree {file_name}"; s.executeUpdate(createTableIndexString); con.commit(); s.close(); con.close(); } catch (SQLException ex) { System.err.print("SQLException: "); System.err.println(ex.getMessage()); } } } If this is not a bug, any hints or examples of the correct way to do this would be appreciated. I am unsure how to grab a stack trace, if one is needed please send me an example and I will be glad to add the code and re-run the test to provide that information. Thanks, Jim D.