Re: exit code -1073741819

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: delphet(at)excite(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: exit code -1073741819
Date: 2007-07-11 19:33:41
Message-ID: 122.1184182421@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Shuo Liu" <delphet(at)excite(dot)com> writes:
>> Whoa ... that is a whole lot more data than I'm used to seeing in
>> TopMemoryContext. How many stats dump lines are there exactly (from
>> here to the crash report)?

> OK, I didn't know that was a surprise. There are about 600 stats dump lines
> in between.

Well, my suspicion was correct: there were boatloads of memory contexts,
but we weren't seeing all of them. The answer is twofold:

1. Your function is opening a cursor (maybe more than one, I didn't read
too carefully) on each iteration, and not closing it. This results in
a sizable amount of memory being eaten --- it looks like a couple
hundred K per cursor on my machine. Eventually you run out of memory.

2. PostGIS has a bug that causes a guaranteed crash once you run out of
memory, if you've been using transform(), because it sets up a memory
context that has no stats() method. That's why the context stats
printout failed partway through --- it crashed as soon as it came to
one of the PostGIS contexts.

I've complained to the PostGIS folk about the latter, and hopefully
they'll fix it in their next release. Meanwhile, you need to be more
careful about closing cursors when you're done with them.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2007-07-11 19:36:54 Re: how does a temp table work?
Previous Message lawpoop 2007-07-11 19:26:45 optimizing postgres