From: marek at lewczuk.com (Marek Lewczuk) Date: Tue, 11 Apr 2006 09:49:28 +0200 Subject: [Pljava-dev] out of memory Message-ID: Hello Thomas, I have a problem with pljava - it seems that it takes to much memory, which cause that postgresql process hangs. This is what I have in serverlog: SPI TupTable: 8192 total in 1 blocks; 7352 free (0 chunks); 840 used Operator class cache: 8192 total in 1 blocks; 4936 free (0 chunks); 3256 used MessageContext: 8192 total in 1 blocks; 6400 free (3 chunks); 1792 used smgr relation table: 8192 total in 1 blocks; 808 free (0 chunks); 7384 used Portal hash: 8380416 total in 10 blocks; 1501976 free (34 chunks); 6878440 used PortalMemory: 8380416 total in 10 blocks; 1325528 free (14 chunks); 7054888 used PortalHeapMemory: 15360 total in 4 blocks; 8064 free (0 chunks); 7296 used ExecutorState: 24576 total in 2 blocks; 12352 free (2 chunks); 12224 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used PortalHeapMemory: 15360 total in 4 blocks; 8064 free (0 chunks); 7296 used ExecutorState: 24576 total in 2 blocks; 12352 free (2 chunks); 12224 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used PortalHeapMemory: 15360 total in 4 blocks; 8064 free (0 chunks); 7296 used ExecutorState: 24576 total in 2 blocks; 12352 free (2 chunks); 12224 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used PortalHeapMemory: 15360 total in 4 blocks; 8064 free (0 chunks); 7296 used ExecutorState: 24576 total in 2 blocks; 12352 free (2 chunks); 12224 used ExprContext: 0 total in 0 blocks; 0 free (0 chunks); 0 used ... and so on... The code is very simple, I execute the query (large query, with ~120000 rows) and process each single row: Connection connection = DriverManager.getConnection("jdbc:default:connection"); Statement statement = connection.createStatement(); ResultSet result; statement.execute("...."); result = statement.getResultSet(); // process each row while (result.next()) { ... some other things, new Statements (but each single statement is closed) } statement.close(); Any ideas ? Best regards, Marek Lewczuk