Re: Memory Errors...

From: "Ian Harding" <ianh(at)tpchd(dot)org>
To: <pgsql-general(at)postgresql(dot)org>, <ianh(at)tpchd(dot)org>
Subject: Re: Memory Errors...
Date: 2002-09-19 14:47:16
Message-ID: sd89814e.017@mail.tpchd.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

OK, I lied. I changed something inside the first function.

It calls another function that now uses a temporary table. It creates, uses and drops the table. It is usually called only once per transaction, but it is called repeatedly from the main function in this case. When I run the function, the memory numbers reported by top climb quickly until it blows up. I wonder if this has anything to do with it.

I am using connection pooling, so if I don't explicitly drop the temp table, it might be lying around for other users to see. That is probably OK if I check for its existence, then truncate it before using it.

Any of this make sense?

Ian

>>> "Ian Harding" <ianh(at)tpchd(dot)org> 09/19/02 07:10AM >>>
Can someone tell me what these mean? They happen when running big ugly pgtcl functions that delete, insert and update lots of stuff in the database.

ERROR: Memory exhausted in AllocSetContextCreate(8192)
ERROR: Memory exhausted in AllocSetAlloc(88)
ERROR: Memory exhausted in AllocSetAlloc(60)

Seems pretty straightforward, "You ran out of memory, dummy!" But the functions that are running here used to work fine. The only thing I changed was recompiling my kernel to change the following line:

options SHMMAXPGS=8192 # 1024 pages is the default

which I thing brings my maximum amount of shared memory from about 4 MB to about 32 MB. (256 MB is installed) I then changed the line in postgresql.conf like this:

shared_buffers = 3000 # 2*max_connections, min 16

which I think says "PostgreSQL, there is about 24 MB of shared memory available to you."

You would think this would be better, not worse, than the defaults.

The machine has 256 MB of RAM. It is running both PostgreSQL and AOLServer. It is NetBSD 1.5.2 and PostgreSQL 7.2.1:

PostgreSQL 7.2.1 on i386--netbsdelf, compiled by GCC egcs-1.1.2

Since I don't know what I am doing, I tried to be conservative in bumping up the numbers having to do with memory.

Should I be looking at my function, or did I botch the memory configuration so badly that it is breaking stuff?

Thanks!

Ian

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2002-09-19 15:06:18 Re: Adding "on delete cascade" after table creation ?
Previous Message Shridhar Daithankar 2002-09-19 14:44:55 Re: killing process question