Обсуждение: Memory exhausted in AllocSetAlloc()

Поиск
Список
Период
Сортировка

Memory exhausted in AllocSetAlloc()

От
Thomas Heinis
Дата:
Hey everybody,
whenever I do a 'select * from profil_ext2;' I get

FATAL 1:  Memory exhausted in AllocSetAlloc()
pqReadData() -- backend closed the channel unexpectedly.
        This probably means the backend terminated abnormally
        before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.

Now, I read the manual and I know that one can use ulimit to increase
the size of virtual memory. But with ulimit -a I get the following
listing:
core file size (blocks)  1000000
data seg size (kbytes)   unlimited
file size (blocks)       unlimited
max memory size (kbytes) unlimited
stack size (kbytes)      8192
cpu time (seconds)       unlimited
max user processes       2048
pipe size (512 bytes)    8
open files               1024
virtual memory (kbytes)  2105343

And I think 2105343 kbytes is fairly enough virtual memory.

Any suggestions on what I can do?

Thomas


Re: Memory exhausted in AllocSetAlloc()

От
Tom Lane
Дата:
Thomas Heinis <postgres@mailzone.ch> writes:
> whenever I do a 'select * from profil_ext2;' I get

> FATAL 1:  Memory exhausted in AllocSetAlloc()

And the definition of this table is?

            regards, tom lane

Re: Memory exhausted in AllocSetAlloc()

От
Thomas Heinis
Дата:
         Table "profil_ext2"
  Attribute  |    Type     | Modifier
-------------+-------------+----------
 vorname     | varchar(30) |
 name        | varchar(30) |
 strasse     | varchar(40) |
 plz         | varchar(4)  |
 land        | varchar(3)  |
 alias       | varchar(20) |
 redirect    | varchar(80) |
 passwort    | varchar(20) |
 datum       | varchar(16) |
 anrede      | varchar(2)  |
 tel         | varchar(20) |
 fax         | varchar(20) |
 homepage    | varchar(40) |
 newsletter  | varchar(1)  |
 spam_filter | varchar(1)  |
 newzip      | varchar(4)  |
 stub        | varchar(40) |
 ort         | varchar(30) |
 nd_flag     | varchar(1)  |
 sp          | varchar(1)  |

Tom Lane wrote:

> Thomas Heinis <postgres@mailzone.ch> writes:
> > whenever I do a 'select * from profil_ext2;' I get
>
> > FATAL 1:  Memory exhausted in AllocSetAlloc()
>
> And the definition of this table is?
>
>                         regards, tom lane

Re: Memory exhausted in AllocSetAlloc()

От
Thomas Heinis
Дата:
PG version is 7.0.2, OS is Red Hat Linux 6.2. The table has 614 rows.

Tom Lane wrote:

> >> And the definition of this table is?
>
> Just varchars, huh?  Weird.  What PG version are you running?
> How many rows in the table?
>
>                         regards, tom lane


Re: Memory exhausted in AllocSetAlloc()

От
Tom Lane
Дата:
Thomas Heinis <postgres@mailzone.ch> writes:
>> Just varchars, huh?  Weird.  What PG version are you running?
>> How many rows in the table?
>
> PG version is 7.0.2, OS is Red Hat Linux 6.2. The table has 614 rows.

The only thing I can think of is that the table has gotten corrupted so
that one or more of the varchar values appears huge --- ie, its length
word claims to be many megabytes instead of the correct value.

You should be able to home in on the corrupted row(s) by elimination:
figure out which rows you can select and which not.  You can probably
even select the non-corrupted columns in the bad rows.  Once you delete
the bad rows things should be OK again ... though a dump/initdb/reload
might be a good idea in case there are other problems.  Did you suffer
a system crash recently?

            regards, tom lane