Aggro <[EMAIL PROTECTED]> writes: > But is the memory freed at some point? E.g. when > program shuts down? If it is not freed ever, then it > is a memory leak.
Program-local memory is *always* freed at process termination. Any operating system that failed to handle this would be broken beyond usability, because any simple program crash would lead to loss of usable memory. Eventually you'd be forced to reboot the OS just because of application-level bugs. Now, leakage of the Postgres shared memory segment after a postmaster crash is a genuine issue. We have some code that tries to detect and reclaim an orphaned segment, but it's not bulletproof and sometimes manual cleanup (or a reboot) is needed. (It can't be too aggressive because the opposite risk, reclaiming a segment that *is* still in use, would have far worse consequences than a mere memory leak.) > I'm interested in this, because > either you have a memory leak or these is a bug in > another application called cppcheck which claims that > you have a memory leak. We don't put too much stock in automatic leak analysis, because there aren't any automated checkers that understand Postgres' memory context mechanism. They don't know about shmem either ... regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs