Re: High RAM usage on postgres - Mailing list pgsql-general

From Gunnar \"Nick\" Bluth
Subject Re: High RAM usage on postgres
Date
Msg-id 51461B82.9000503@pro-open.de
Whole thread Raw
In response to Re: High RAM usage on postgres  (Scott Marlowe <scott.marlowe@gmail.com>)
List pgsql-general
Am 17.03.2013 09:31, schrieb Scott Marlowe:
> On Thu, Mar 14, 2013 at 12:55 PM, prashantmalik
> <prashantmalikk@gmail.com> wrote:
>>
>> *Query :* "SELECT * FROM customer"
>>
-----------------------------------------------------------------------------------------------------------------------------------------------------------
>> top
>>
>> top - 00:14:38 up 44 days, 12:06,  2 users,  load average: 3.57, 1.34, 0.69
>> Tasks: 243 total,   3 running, 240 sleeping,   0 stopped,   0 zombie
>> Cpu(s):  6.5%us,  0.6%sy,  0.0%ni, 92.5%id,  0.4%wa,  0.0%hi,  0.0%si,
>> 0.0%st
>> Mem:  32949816k total, 31333260k used,  1616556k free,   526988k buffers
>> Swap:  4192956k total,  1989136k used,  2203820k free,  9182092k cached
>>
>>    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
>> 12671 root      25   0 19.8g  19g 1612 R 100.1 62.6   4:31.78 psql

What eats up your memory is "psql", which indeed allocates a whopping
19G physical memory, not the server process.
- Are you sure that is _your_ "psql" selecting "* from customers" and
not somebody else's, doing a cross-join?
- Is there potentially anything that gets TOASTed in your "customer"
table? I'm not sure if that would show up in pg_relation_size and
friends, but it would get sent to psql of course.

Regards,

--
Gunnar "Nick" Bluth
RHCE/SCLA

Mobil   +49 172 8853339
Email: gunnar.bluth@pro-open.de
__________________________________________________________________________
In 1984 mainstream users were choosing VMS over UNIX.  Ten years later
they are choosing Windows over UNIX.  What part of that message aren't you
getting? - Tom Payne



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: sqlj.install_jar stalls
Next
From: Pawel Veselov
Date:
Subject: ORDER BY expression required in SELECT if DISTINCT