From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Heller <th.heller@comtron.net>
Cc: psql <pgsql-admin@postgresql.org>
Subject: Re: FATAL 1: Memory exhausted in AllocSetAlloc()
Date: Thu, 11 Jan 2001 12:18:15 -0500
Message-ID: <11829.979233495@sss.pgh.pa.us> (raw)
In-Reply-To: <004c01c07bc5$993ba2d0$b7217fd4@kjkafjuprmkaec>
References: <004c01c07bc5$993ba2d0$b7217fd4@kjkafjuprmkaec>
"Thomas Heller" <th.heller@comtron.net> writes:
> [ after a system crash, I'm getting ]
> FATAL 1: Memory exhausted in AllocSetAlloc()
An educated guess is that you have a corrupted tuple in some table,
within which a variable-length datum is corrupted in some way that
makes it appear to have a size of hundreds of megabytes (more than
your allowed process swap space, anyway). VACUUM ANALYZE, or anything
else that tries to examine the corrupted datum, will start out by
trying to palloc() as much space as the datum's length word says it
needs. Malloc failure leads to the above complaint and emergency
stop. No (further) harm done to your table, fortunately.
What you want to do is narrow down the location of the bad tuple (or
tuples; there might be more than one) and then delete it. It should
be easy enough to determine which table(s) contain bad data --- one
way is to VACUUM ANALYZE tables one at a time to see which ones fail.
To locate the bad tuple, one way is to do
SELECT * FROM foo LIMIT n;
for various n and see which queries succeed and which don't. With
a little bit of homing in, you can determine that the n'th tuple of
the table is broken. Then you can do something like
SELECT oid FROM foo OFFSET n-1 LIMIT 1;
DELETE FROM foo WHERE oid = value-just-determined;
to zap the tuple without trying to examine its corrupted column.
Repeat if necessary until all tables are clean ...
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, th.heller@comtron.net
Subject: Re: FATAL 1: Memory exhausted in AllocSetAlloc()
In-Reply-To: <11829.979233495@sss.pgh.pa.us>
References: <004c01c07bc5$993ba2d0$b7217fd4@kjkafjuprmkaec> <11829.979233495@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox