Possible memory leak with SQL function?
От
Yeb Havinga
Тема
Possible memory leak with SQL function?
Дата
Msg-id
52318977.3090807@gmail.com
Список
Дерево обсуждения
Possible memory leak with SQL function? Yeb Havinga <yebhavinga@gmail.com>
Re: Possible memory leak with SQL function? Robert Haas <robertmhaas@gmail.com>
Re: Possible memory leak with SQL function? Yeb Havinga <yebhavinga@gmail.com>
Re: Possible memory leak with SQL function? Tom Lane <tgl@sss.pgh.pa.us>
Re: Possible memory leak with SQL function? Greg Stark <stark@mit.edu>
Hello list, Is the following known behaviour, or should I put some time in writing a self contained test case? We have a function that takes a value and returns a ROW type. With the function implemented in language SQL, when executing this function in a large transaction, memory usage of the backend process increases. MemoryContextStats showed a lot of SQL function data. Debugging init_sql_fcache() showed that it was for the same function oid each time, and the oid was the function from value to ROW type. When the function is implemented in PL/pgSQL, the memory usage was much less. I'm sorry I cannot be more specific at the moment, such as what is 'much less' memory with a PL/pgSQl function, and are there as many SQL function data's as calls to the SQL function, because I would have to write a test case for this. I was just wondering, if this is known behavior of SQL functions vs PL/pgSQL functions, or could it be a bug? -- Yeb Havinga http://www.mgrid.net/ Mastering Medical Data
В списке pgsql-hackers по дате отправления
От: Heikki Linnakangas
Дата: