Retrieve memory size allocated by libpq

Поиск
Список
Период
Сортировка
От Lars Kanis
Тема Retrieve memory size allocated by libpq
Дата
Msg-id fa16a288-9685-14f2-97c8-b8ac84365a4f@greiz-reinsdorf.de
обсуждение исходный текст
Ответы Re: Retrieve memory size allocated by libpq  (Lars Kanis <lars@greiz-reinsdorf.de>)
Список pgsql-hackers
Hello,

I would like to be able to retrieve the size of memory internally
allocated by libpq for a result. The reason is that we have a Ruby
wrapper that exposes libpq in Ruby. The problem is that Ruby's GC
doesn't know how much memory has been allocated by libpq, so no pressure
is applied to the GC when it should be. With this function we could
instruct the GC about the memory usage associated to each result object.

This issue has already been discussed in the following thread, with the
request to use custom malloc/realloc/free functions:

https://www.postgresql.org/message-id/flat/20170828172834.GA71455%40TC.local#20170828172834.GA71455@TC.local

Retrieving the allocated memory size is another approach to solve the
same base issue. However since the relation between memory consumption
and the particular result object is maintained, it can additionally be
used to provide diagnostic information to each object.

What do you think about adding such a function?

--
Kind Regards,
Lars


Вложения

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

Предыдущее
От: Sergei Kornilov
Дата:
Сообщение: Log query parameters for terminated execute
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Log query parameters for terminated execute