On Wed, 6 Sep 2006 18:26:46 -0400
Jonathan Vanasco wrote:

>
> On Sep 6, 2006, at 6:01 PM, Frank Wiles wrote:
>
> > It didn't disappear, and it isn't "shared" like the type of
> > sharing we talk about with mod_perl/Apache. It's not CoW sharing.

> I know.
>
> > The shared memory you're talking about here is held by the
> > postmaster
> > daemon and is used to store frequently requested data to be used
> > by the forked children via SysV IPC.

>
> Yes. I know that. pg_stop is the stopping of the postmaster daemon
> -- not clients ( apache stop will kill the pids of the clients ).
>
> > And yeah, PostgreSQL cleans up it's shared memory when it exits
> > like it should.

>
> No, its not. thats the point of my post.


Sorry I guess I misunderstood what you were saying.

> On my system, shared memory that was allocated to postgres is not
> being returned. postgres's exit releases the lock on memory-- ipcs
> shows nothing allocated. but the kernel never gains any of that
> shared mem. i only see about the size of the resident memory of the
> postmaster instance and the clients returned.
>
> I'm inclined to think this 'leak' is in postgres and not in
> Apache/MP/ DBI, because it happens to pg via the command line
>
> the long running process where i found this behavior started off at
> about 850mb of free memory. earlier today my machine was down to
> 241mb free- a stop/wait/start of apache brought me to 317 and a
> restart of pg brought me to 321. thats about 500mb vanished.
>
> then i remembered this post, started poking around , and saw memory
> disappear and never made available in proportion to the pg vsize
> ( the clients themselves are nothing).


Is that 500MB that "vanished" in used, buffers, or cached? Just
because it isn't listed in "free" doesn't mean it isn't "free" from
a "Available memory I can use" standpoint. For example, your system
will reclaim memory from cached and buffers when it runs out of
"free".

---------------------------------
Frank Wiles
http://www.wiles.org
---------------------------------