From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | Ben Chobot <bench(at)silentmedia(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Really out of memory? |
Date: | 2009-06-02 21:01:27 |
Message-ID: | 20090602210127.GB5604@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Tue, Jun 02, 2009 at 11:45:11AM -0700, Ben Chobot wrote:
> On Tue, 2 Jun 2009, Martijn van Oosterhout wrote:
>
>> On Tue, Jun 02, 2009 at 11:10:04AM -0700, Ben Chobot wrote:
>
>>> May 31 02:59:40 sfmelwss postgres[30103]: [1-1] ERROR: out of memory
>>> May 31 02:59:40 sfmelwss postgres[30103]: [1-2] DETAIL: Failed on request of size 16777212.
>>
>> Add even more swap. By turning overcommit off you make the kernel
>> really pessimistic about how much memory is in use.
>
> Is it so pessimistic that it won't try to swap out 16MB into almost 1GB
> of free swap? That seems surprising to me.
It's got nothing to do with how much swap is in use. It's preventing
you from allocating memory that *hypothetically* might not be available
if every byte of allocated memory were actually used.
For example, on my desktop I have 1GB of RAM of which about 600MB is
free, yet there is 1.4GB committed. With overcommit off my machine
may not boot. As you can see, only 25% of committed memory is actually
needed, because lots of pages are blank or shared. Ofcourse, all those
copies of libc are realistically never not going to be shared so it's a
good bet.
But with overcommit off you can see that you might want to have double
or triple the amount of swap to handle the hypothetical case.
I'm not saying this is necessarily the case for you, but it's the first
thing that came to mind and relatively easy to check.
Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.
From | Date | Subject | |
---|---|---|---|
Next Message | Douglas Alan | 2009-06-02 21:36:50 | Re: How can I manually alter the statistics for a column? |
Previous Message | Geoffrey | 2009-06-02 20:51:47 | Re: warm standby with WAL shipping |