Question about lazy_space_alloc() / linux over-commit

Поиск
Список
Период
Сортировка
От Jim Nasby
Тема Question about lazy_space_alloc() / linux over-commit
Дата
Msg-id 54EE474A.4040601@BlueTreble.com
обсуждение исходный текст
Ответы Re: Question about lazy_space_alloc() / linux over-commit  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Could the large allocation[2] for the dead tuple array in 
lazy_space_alloc cause problems with linux OOM? [1] and some other 
things I've read indicate that a large mmap will count towards total 
system memory, including producing a failure if overcommit is disabled.

Would it be worth avoiding the full size allocation when we can?

If we did this, I think allocate reltuples * autovacuum_vacuum_threshold 
slots initially, and then growing the array if needed.

1: 
http://stackoverflow.com/questions/9129004/why-does-calling-mmap-with-large-size-not-fail

2:
In lazy_space_alloc() we will palloc the dead tuple array to be as large 
as maintenance_work_mem, with the only limit being that we won't make it 
larger than the maximum possible number of tuples in the relation.

My understanding is that this doesn't suck only because palloc passes 
such a large allocation direct to malloc, which in turn uses mmap, which 
won't actually allocate the memory until we access it.
-- 
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: INSERT ... ON CONFLICT UPDATE and logical decoding
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: contrib/fuzzystrmatch/dmetaphone.c license