Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 624292a

Browse files
committed
Ensure that all places that are complaining about exhaustion of shared
memory say 'out of shared memory'; some were doing that and some just said 'out of memory'. Also add a HINT about increasing max_locks_per_transaction where relevant, per suggestion from Sean Chittenden. (The former change does not break the strings freeze; the latter does, but I think it's worth doing anyway.)
1 parent 2ec7443 commit 624292a

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/backend/storage/ipc/shmem.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.72 2003/09/25 06:58:02 petere Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmem.c,v 1.73 2003/10/16 20:59:35 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -167,7 +167,7 @@ ShmemAlloc(Size size)
167167
if (!newSpace)
168168
ereport(WARNING,
169169
(errcode(ERRCODE_OUT_OF_MEMORY),
170-
errmsg("out of memory")));
170+
errmsg("out of shared memory")));
171171

172172
return newSpace;
173173
}
@@ -226,7 +226,7 @@ InitShmemIndex(void)
226226
if (!result)
227227
ereport(FATAL,
228228
(errcode(ERRCODE_OUT_OF_MEMORY),
229-
errmsg("out of memory")));
229+
errmsg("out of shared memory")));
230230

231231
Assert(ShmemBootstrap && !found);
232232

@@ -346,7 +346,7 @@ ShmemInitStruct(const char *name, Size size, bool *foundPtr)
346346
LWLockRelease(ShmemIndexLock);
347347
ereport(ERROR,
348348
(errcode(ERRCODE_OUT_OF_MEMORY),
349-
errmsg("out of memory")));
349+
errmsg("out of shared memory")));
350350
return NULL;
351351
}
352352

src/backend/storage/lmgr/lock.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.127 2003/08/17 22:41:12 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/lock.c,v 1.128 2003/10/16 20:59:35 tgl Exp $
1212
*
1313
* NOTES
1414
* Outside modules can create a lock table and acquire/release
@@ -476,8 +476,8 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
476476
LWLockRelease(masterLock);
477477
ereport(ERROR,
478478
(errcode(ERRCODE_OUT_OF_MEMORY),
479-
errmsg("out of memory")));
480-
return FALSE;
479+
errmsg("out of shared memory"),
480+
errhint("You may need to increase max_locks_per_transaction.")));
481481
}
482482

483483
/*
@@ -524,8 +524,8 @@ LockAcquire(LOCKMETHOD lockmethod, LOCKTAG *locktag,
524524
LWLockRelease(masterLock);
525525
ereport(ERROR,
526526
(errcode(ERRCODE_OUT_OF_MEMORY),
527-
errmsg("out of memory")));
528-
return FALSE;
527+
errmsg("out of shared memory"),
528+
errhint("You may need to increase max_locks_per_transaction.")));
529529
}
530530

531531
/*

src/backend/storage/lmgr/proc.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.135 2003/10/11 18:04:25 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/storage/lmgr/proc.c,v 1.136 2003/10/16 20:59:35 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -151,7 +151,7 @@ InitProcGlobal(int maxBackends)
151151
if (!proc)
152152
ereport(FATAL,
153153
(errcode(ERRCODE_OUT_OF_MEMORY),
154-
errmsg("out of memory")));
154+
errmsg("out of shared memory")));
155155
MemSet(proc, 0, sizeof(PGPROC));
156156
PGSemaphoreCreate(&proc->sem);
157157
proc->links.next = ProcGlobal->freeProcs;
@@ -167,7 +167,7 @@ InitProcGlobal(int maxBackends)
167167
if (!DummyProc)
168168
ereport(FATAL,
169169
(errcode(ERRCODE_OUT_OF_MEMORY),
170-
errmsg("out of memory")));
170+
errmsg("out of shared memory")));
171171
MemSet(DummyProc, 0, sizeof(PGPROC));
172172
DummyProc->pid = 0; /* marks DummyProc as not in use */
173173
PGSemaphoreCreate(&DummyProc->sem);

0 commit comments

Comments
 (0)