Re: Question about MemoryContexts and functions that returns sets.

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Question about MemoryContexts and functions that returns sets.
Дата
Msg-id 20060320110340.GD21428@svana.org
обсуждение исходный текст
Ответ на Question about MemoryContexts and functions that returns sets.  (Thomas Hallgren <thomas@tada.se>)
Ответы Re: Question about MemoryContexts and functions that returns  (Thomas Hallgren <thomas@tada.se>)
Список pgsql-hackers
On Mon, Mar 20, 2006 at 11:47:41AM +0100, Thomas Hallgren wrote:
> 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:

It's not clear exactly what you are doing, but the Datum you return
points to memory allocated *somewhere*. If you have palloc()ed it in
your own MemoryContext then you must free it the next time you are
called. Normally this is acheived by restting your context each time,
although you could free if you wished.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Hallgren
Дата:
Сообщение: Question about MemoryContexts and functions that returns sets.
Следующее
От: Thomas Hallgren
Дата:
Сообщение: Re: Question about MemoryContexts and functions that returns