Thread: memory strangeness

memory strangeness

From
Gregor Mosheh
Date:
Hiya. I've installed Postgres 7.2 on a dedicated FreeBSD system with 384
MB RAM. Because the system will be doing nothing except PG, I'd like to
dump as much memory as possible into PG's shared memory.

I rebuilt the kernel with very large limits: 330 MB on the MAXDSIZ and
DFLDSIZ, and 330 MB for SHMMAXPAGES. This gives me:

# sysctl kern.ipc.shmall
kern.ipc.shmall: 42240
# sysctl kern.ipc.shmmax
kern.ipc.shmmax: 346030080

I still cannot set PG's shared_buffers higher than 20000 (160 MB):

IpcMemoryCreate: shmget(key=8971001, size=183017472, 03600) failed: Cannot
allocate memory
This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space.
To reduce the request size (currently 183017472 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 22000) and/or
its max_connections parameter (currently 5).


That I'm out of RAM seems fishy, though, since there's very little running
and vmstat reports plenty of free RAM:

 procs      memory      page                    disks     faults      cpu
 r b w     avm    fre  flt  re  pi  po  fr  sr ad0 ad3   in   sy  cs us sy
id
 0 0 0    8484 353908    1   0   0   0   2   0   2   0  231    5   5  0  0
100



Any ideas as to what I missed?