Thread: memory leaks fixed?

memory leaks fixed?

From
"Nick T"
Date:
Hi all:

Just finished reading all of the comments at

http://openacs.org/philosophy/why-not-mysql.html

and became concerned about the comments regarding severe memory leaks with
PostgreSQL.  Is this true?  Have they been fixed?  Are there any
workarounds?

Thank you

Nick



Re: memory leaks fixed?

From
Denis Perchine
Date:
Hello,

> Just finished reading all of the comments at
>
> http://openacs.org/philosophy/why-not-mysql.html
>
> and became concerned about the comments regarding severe memory leaks with
> PostgreSQL.  Is this true?  Have they been fixed?  Are there any
> workarounds?

There are some still. Although not that large as mentioned in the comments.
If you have long-running cursor, and tables involved in this cursor are
heavily updated, you will end with 200Mb postmaster in 1-2 days.

--
Sincerely Yours,
Denis Perchine

----------------------------------
E-Mail: dyp@perchine.com
HomePage: http://www.perchine.com/dyp/
FidoNet: 2:5000/120.5
----------------------------------

Re: memory leaks fixed?

From
Peter Eisentraut
Date:
Nick T writes:

> Just finished reading all of the comments at
>
> http://openacs.org/philosophy/why-not-mysql.html
>
> and became concerned about the comments regarding severe memory leaks with
> PostgreSQL.  Is this true?  Have they been fixed?  Are there any
> workarounds?

There are certain queries that require a seemingly unproportional amount
of memory.  Up until verion 7.0, memory in the server was not recovered
until the end of the transaction, so it was possible to run out of memory
when it should have been avoidable.  This is technically not a memory
leak, just a less than optimal use of resources.  However, because of the
way malloc/sbrk work, this memory is no longer available to the operating
system, so it looks like a memory leak.

7.1 uses a better technique to handle the allocated memory, which should
fix most of these cases.  In any case it should be possible to rewrite the
queries, but there is no general procedure on how to do that.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/