Re: [HACKERS] backend dies suddenly after a lot of error messages

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jwieck(at)debis(dot)com (Jan Wieck)
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [HACKERS] backend dies suddenly after a lot of error messages
Date: 1999-05-12 17:44:01
Message-ID: 25352.926531041@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

jwieck(at)debis(dot)com (Jan Wieck) writes:
>> Yeah, I'd say so --- all the memory used should get freed at transaction
>> end, but evidently it isn't happening.

> I remember to have taken some but haven't found all the
> places. I think there's still something in tcop where the
> querytree list is malloc()'d.

I saw that yesterday --- for no particularly good reason, postgres.c
wants to deal with the query list as an array rather than a list;
it goes to great lengths to convert the lists it's given into an array,
which it has to be able to resize, etc etc. I was thinking of ripping
all that out and just using a palloc'd list. At the time I didn't have
any justification for it except code beautification, which isn't a good
enough reason to be changing code late in beta... but a memory leak
is...

However, the leakage being complained of seems to be several kilobytes
per failed command, which is much more than that one malloc usage can
be blamed for. Any other thoughts? I was wondering if maybe a whole
palloc context somewhere is getting lost; not sure where to look though.
One thing I did find was that leakage occurs very early. You can feed
the system commands that will fail in parsing, like say
garbage;
and the memory usage still rises with each one.

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 1999-05-12 17:51:18 WHERE vs HAVING
Previous Message Jan Wieck 1999-05-12 17:04:00 Re: [HACKERS] Update Open Items list