diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 1999-02-22 06:16:57 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 1999-02-22 06:16:57 +0000 |
commit | bcfdc9df046c159e973149f2a82acc99d07d7b83 (patch) | |
tree | 9b31789e9b1e9239073a3965d00a332828e1e222 /src/backend/storage/ipc/ipci.c | |
parent | ceb233ed1105a0ac6022fc6a4558c2cfaf0d240b (diff) |
Repair some pretty serious problems in dynahash.c and
shared memory space allocation. It's a wonder we have not seen bug
reports traceable to this area ... it's quite clear that the routine
dir_realloc() has never worked correctly, for example.
Diffstat (limited to 'src/backend/storage/ipc/ipci.c')
-rw-r--r-- | src/backend/storage/ipc/ipci.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/backend/storage/ipc/ipci.c b/src/backend/storage/ipc/ipci.c index 49259807b40..2f5d1d3a193 100644 --- a/src/backend/storage/ipc/ipci.c +++ b/src/backend/storage/ipc/ipci.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.21 1999/02/21 01:41:44 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/storage/ipc/ipci.c,v 1.22 1999/02/22 06:16:49 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -72,11 +72,19 @@ CreateSharedMemoryAndSemaphores(IPCKey key, int maxBackends) * ---------------- */ CreateSpinlocks(IPCKeyGetSpinLockSemaphoreKey(key)); - size = BufferShmemSize() + LockShmemSize(maxBackends); + /* + * Size of the primary shared-memory block is estimated via + * moderately-accurate estimates for the big hogs, plus 100K for + * the stuff that's too small to bother with estimating. + * Then we add 10% for a safety margin. + */ + size = BufferShmemSize() + LockShmemSize(maxBackends); #ifdef STABLE_MEMORY_STORAGE size += MMShmemSize(); #endif + size += 100000; + size += size / 10; if (DebugLvl > 1) { |