X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 5CDD09FB0D1 for ; Thu, 11 May 2006 23:51:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 30919-02 for ; Thu, 11 May 2006 23:51:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 982209FADD1 for ; Thu, 11 May 2006 23:51:19 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id k4C2pCfW019951; Thu, 11 May 2006 22:51:12 -0400 (EDT) To: "Craig A. James" cc: Chris , pgsql-performance@postgresql.org Subject: Re: Postgres gets stuck In-reply-to: <4463EE89.8010103@modgraph-usa.com> References: <446135F9.1060608@modgraph-usa.com> <4461391D.2000800@gmail.com> <44635DFE.1060509@modgraph-usa.com> <18707.1147392206@sss.pgh.pa.us> <4463EE89.8010103@modgraph-usa.com> Comments: In-reply-to "Craig A. James" message dated "Thu, 11 May 2006 19:10:17 -0700" Date: Thu, 11 May 2006 22:51:12 -0400 Message-ID: <19950.1147402272@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/322 X-Sequence-Number: 19109 "Craig A. James" writes: > I guess I misinterpreted the Postgress manual, which says (in 31.9, "C Language Functions"), > "When allocating memory, use the PostgreSQL functions palloc and pfree > instead of the corresponding C library functions malloc and free." > I imagined that perhaps palloc/pfree used mutexes for something. But if I understand you, palloc() and pfree() are just wrappers around malloc() and free(), and don't (for example) make their own separate calls to brk(2), sbrk(2), or their kin. Correct. palloc/pfree are all about managing the lifetime of memory allocations, so that (for example) a function can return a palloc'd data structure without worrying about whether that creates a long-term memory leak. But ultimately they just use malloc/free, and there's certainly not any threading or mutex considerations in there. > No threading anywhere. None of the libraries use threads or mutexes. It's just plain old vanilla C/C++ scientific algorithms. Darn, my best theory down the drain. >> Or it could be a garden variety glibc bug. How up-to-date is your >> platform? > I guess this is the next place to look. Let us know how it goes... regards, tom lane