Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C60372E00F7 for ; Sun, 24 Feb 2008 00:16:38 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58277-10 for ; Sun, 24 Feb 2008 00:16:36 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 4F0E42E00FD for ; Sun, 24 Feb 2008 00:16:36 -0400 (AST) 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 m1O4GVlG029391; Sat, 23 Feb 2008 23:16:31 -0500 (EST) To: "Peter Koczan" cc: "Dawid Kuroczko" , "pgsql-admin@postgresql.org" Subject: Re: PL/pgSQL memory consumption? In-reply-to: <4544e0330802231917x2045466s735989836698df2@mail.gmail.com> References: <758d5e7f0802220523x12a444ap679e51b990190ccc@mail.gmail.com> <3216.1203692055@sss.pgh.pa.us> <4544e0330802231917x2045466s735989836698df2@mail.gmail.com> Comments: In-reply-to "Peter Koczan" message dated "Sat, 23 Feb 2008 21:17:08 -0600" Date: Sat, 23 Feb 2008 23:16:31 -0500 Message-ID: <29390.1203826591@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.235 tagged_above=0 required=5 tests=AWL=-2.308, URI_NOVOWEL=2.543 X-Spam-Level: X-Archive-Number: 200802/295 X-Sequence-Number: 28369 "Peter Koczan" writes: > Correct me if I'm wrong, as well, but I believe that Linux (and > probably other modern Unices) does code-sharing, meaning that separate > processes referring to the same code/libraries will refer to the same > copy in physical memory. > So, even though each process is seeing 40 MB of libpgsql, there's > likely only 1 copy in physical memory. So, the total memory > consumption in the system from this library is 40 MB, not > 40*num_processes MB. plpgsql.so is not 40MB ... on my machines it's well under 1MB. Anyway the OP specifically stated he was not counting shared text segments. So there's something pretty weird about these numbers. regards, tom lane