From 85c17dbff8ade0c5237e3ac1ece7cacacfdde399 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 6 Feb 2001 01:53:53 +0000 Subject: Out-of-bounds memory allocation request sizes should be treated as just elog(ERROR) not an Assert trap, since we've downgraded out-of-memory to elog(ERROR) not a fatal error. Also, change the hard boundary from 256Mb to 1Gb, just so that anyone who's actually got that much memory to spare can play with TOAST objects approaching a gigabyte. --- src/include/utils/memutils.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/include/utils/memutils.h') diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h index 28cf6b33549..7ba0719dcb5 100644 --- a/src/include/utils/memutils.h +++ b/src/include/utils/memutils.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: memutils.h,v 1.41 2001/01/24 19:43:28 momjian Exp $ + * $Id: memutils.h,v 1.42 2001/02/06 01:53:52 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -22,16 +22,17 @@ /* * MaxAllocSize - * Arbitrary limit on size of allocations. + * Quasi-arbitrary limit on size of allocations. * * Note: * There is no guarantee that allocations smaller than MaxAllocSize * will succeed. Allocation requests larger than MaxAllocSize will * be summarily denied. * - * XXX This should be defined in a file of tunable constants. + * XXX This is deliberately chosen to correspond to the limiting size + * of varlena objects under TOAST. See VARATT_MASK_SIZE in postgres.h. */ -#define MaxAllocSize ((Size) 0xfffffff) /* 16G - 1 */ +#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */ #define AllocSizeIsValid(size) (0 < (size) && (size) <= MaxAllocSize) -- cgit v1.2.3