Re: PostgreSQL 8.0.6 crash

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: PostgreSQL 8.0.6 crash
Дата
Msg-id 87u0b75btl.fsf@stark.xeocode.com
обсуждение исходный текст
Ответ на Re: PostgreSQL 8.0.6 crash  (Martijn van Oosterhout <kleptog@svana.org>)
Ответы Re: PostgreSQL 8.0.6 crash  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Martijn van Oosterhout <kleptog@svana.org> writes:

> Disabling overcommit has a serious cost in that most of your VM will
> never be used. Are people really suggesting that I can't run a few
> daemons, X and a web-browser on FreeBSD without allocating 3 times my
> physical memory in swap?

There's a possibility you're misreading your process info there. The X server
maps large areas of graphics memory in its address space which shows up as
virtual memory used in ps on some OSes. I'm not sure if BSD is included there.
That's not memory that can ever be swapped out and it doesn't take up any
memory from the non-video memory.

That said, it's true that some applications allocate much more memory than
needed. There's a bit of a feedback loop here. Because application writers
know that OSes overcommit they don't worry about avoiding unnecessary
allocations. Sun's original Java memory management system just started off
with allocating 20MB before it ran a single bytecode for example. 

That's why merely allocating tons of swap doesn't necessarily protect you.
It's still possible for a process (or several processes if you allocate more
swap than you have address space) to mmap gigabytes of memory without touching
it and then start touching those pages. Hopefully the OOM killer targets the
offender but there's no real way for it to guarantee it.

-- 
greg



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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Re: Scrollable cursors and Sort performance
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Scrollable cursors and Sort performance