Postgres utils chewing RAM

From: Steve Lane <slane(at)fmpro(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Postgres utils chewing RAM
Date: 2002-04-29 05:35:38
Message-ID: B8F245DA.C8DE%slane@fmpro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I seem to be having a problem with the postgres utilities chewing a lot of
RAM. I've been running PG 7.1 under LinuxPPC on a PowerMac G4. After a few
days of use, free memory degrades to almost nothing. I logged memory usage
for a while and found that free memory would suddenly drop by 200-300 meg
every night at 1:20 AM, right when my nightly maintenance scripts run.

I traced through the nightly scripts and found that two things seem to
account for the memory loss -- vacuuming the databases, and backing them up.
I restarted to free all my RAM back up and tried just those operations. Sure
enough, after a vacuum verbose analyze (on about thirty tables totaling
probably less than 50 MB of data), free memory dropped by 130MB. Backing up
everything on the server took another 110MB. And this memory never gets
returned.

Is this something to do with shared memory? I've raised the max shared mem
and directed postgres to take 128 MB of it. Ipcs says this:

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x0052e2c1 0 postgres 600 127934464 1
0x00000000 1 nobody 600 46084 6 dest

------ Semaphore Arrays --------
key semid owner perms nsems status
0x0052e2c1 0 postgres 600 17
0x0052e2c2 1 postgres 600 17
0x0052e2c3 2 postgres 600 17
0x0052e2c4 3 postgres 600 17
0x00000000 4 nobody 600 1

------ Message Queues --------
key msqid owner perms used-bytes messages

Which looks right to me.

Why does my free mem just disappear when I run vacuum and pg_dump?

Thanks,

steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message postgres 2002-04-29 05:51:23 Re: Postgres utils chewing RAM
Previous Message Martijn van Oosterhout 2002-04-29 04:52:38 Re: icps, shmmax and shmall - Shared Memory tuning