Search Postgresql Archives

Re: Really out of memory?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while 
> boarding. Thank you for flying nlogn airlines.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux