Skip site navigation (1) Skip section navigation (2)

Re: plpgsql function seems to be leaking memory

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marc Cousin <mcousin(at)sigma(dot)fr>, pgsql-admin(at)postgresql(dot)org
Subject: Re: plpgsql function seems to be leaking memory
Date: 2008-06-26 15:48:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Tom Lane a écrit :
> Guillaume Lelarge <guillaume(at)lelarge(dot)info> writes:
>> Tom Lane a écrit :
>>> What do you have shared_buffers set to?  I think you might be getting
>>> fooled by top's treatment of shared memory (ie, it starts to count
>>> shared pages after the process touches them for the first time).
>> That's what I thought at first when I saw Marc's email. I tried his 
>> example many times, with different values for shared_buffers. RSS column 
>> climbs until it reaches more or less the shared_buffers configuration. 
>> But, if I launch another psql, this process will have a much lower value 
>> on the RSS column. Shouldn't it get the RSS at the same value, even when 
>> the process starts ?
> No, that's exactly the point.  Linux top includes in a process's
> reported size its actual private space, plus however many pages of
> shared memory that process has physically accessed so far.  So any PG
> backend that's doing a material amount of table access is going to show
> an RSS that starts low and creeps up to roughly the size of your shared
> memory block, quite independently of what its actual private space usage
> is.  It's just a matter of how many buffers it has had occasion to use.
> This is all pretty OS-dependent.  Some systems don't count shared memory
> at all (HPUX seems not to), and some other ones report a separate total
> for shared memory so that you can mentally subtract it.

Forgot to thank you for the answer... Thanks :)


In response to

pgsql-admin by date

Next:From: Simon RiggsDate: 2008-06-26 16:06:52
Subject: Re: Warm standby server
Previous:From: Scott WhitneyDate: 2008-06-26 15:19:53
Subject: Warm standby server

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group