Question about MemoryContexts and functions that returns sets. - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Question about MemoryContexts and functions that returns sets.
Date
Msg-id 441E884D.7010707@tada.se
Whole thread Raw
Responses Re: Question about MemoryContexts and functions that returns sets.
List pgsql-hackers
Hi,
A PL/Java user reports that his backend runs out of memory when he uses 
PL/Java to execute huge queries towards a remote database and return the 
result. PL/Java is designed not to collect data in memory when it 
returns result sets. Each call to the function handler will be 
dispatched to the corresponding 'ResultSet.next()' in order to retrieve 
and propagate one row at a time. Yet, it seems the data is collected 
somewhere. An excerpt from the user at the time he runs out of memory 
looks like this:

SPI Proc: 273670144 total in 67 blocks; 3840 free (29 chunks); 273666304 used
...
ExecutorState: 1141402016 total in 204 blocks; 7923848 free (3633 chunks); 1133478168 used
...


so obviously, I'm doing something wrong in my code. Any advice what I 
should be looking for?

Kind Regards,
Thomas Hallgren



pgsql-hackers by date:

Previous
From: "Dave Page"
Date:
Subject: Re: [pgsql-advocacy] PostgreSQL Anniversary Proposals --Important Update
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Question about MemoryContexts and functions that returns sets.