Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 3B1B6EDF36F for ; Tue, 22 May 2012 14:33:59 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SWsy4-00071R-Mi for pgsql-admin@postgresql.org; Tue, 22 May 2012 17:33:58 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q4MHXhdx003903; Tue, 22 May 2012 13:33:43 -0400 (EDT) To: Vincent Dautremont cc: pgsql-admin@postgresql.org Subject: Re: out of memory error In-reply-to: References: Comments: In-reply-to Vincent Dautremont message dated "Tue, 22 May 2012 12:44:41 -0400" Date: Tue, 22 May 2012 13:33:43 -0400 Message-ID: <3902.1337708023@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/81 X-Sequence-Number: 39570 Vincent Dautremont writes: > after a few days, i'm seeing the following logs in a database (postgresql > 8.3.15 on Windows) > running with rubyrep 1.2.0 for syncing a few table small that have frequent > update / insert/ delete. > I don't understand it and I'd like to know what happens and why. How to get > rid of it. Well, this is a bit unusual: > TopMemoryContext: 197681816 total in 24131 blocks; 394104 free (24179 > chunks); 197287712 used It's not normal to have so much stuff in TopMemoryContext. That could represent a leak, but it's also possible that that's just management overhead for all of these contexts: > SPI Plan: 1024 total in 1 blocks; 912 free (0 chunks); 112 used > CachedPlan: 1024 total in 1 blocks; 248 free (0 chunks); 776 used > CachedPlanSource: 1024 total in 1 blocks; 96 free (0 chunks); 928 used > SPI Plan: 1024 total in 1 blocks; 928 free (0 chunks); 96 used > . > . > . there it goes for about 80MB of log then it ends > . > . > SPI Plan: 1024 total in 1 blocks; 912 free (0 chunks); 112 used > CachedPlan: 1024 total in 1 blocks; 248 free (0 chunks); 776 used > CachedPlanSource: 1024 total in 1 blocks; 96 free (0 chunks); 928 used That's a *heck* of a lot of SPI plans. You haven't provided any information that would let anybody diagnose why you have so many, though. Tell us about your usage patterns, especially of PL-language functions. regards, tom lane