Re: Really out of memory?

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Really out of memory?
Дата
Msg-id 20090602210127.GB5604@svana.org
обсуждение исходный текст
Ответ на Re: Really out of memory?  (Ben Chobot <bench@silentmedia.com>)
Ответы Re: Really out of memory?  (Ben Chobot <bench@silentmedia.com>)
Список 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@svana.org>   http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Geoffrey
Дата:
Сообщение: Re: warm standby with WAL shipping
Следующее
От: Douglas Alan
Дата:
Сообщение: Re: How can I manually alter the statistics for a column?