Re: Postgres gets stuck - Mailing list pgsql-performance

From Tom Lane
Subject Re: Postgres gets stuck
Date
Msg-id 19950.1147402272@sss.pgh.pa.us
Whole thread Raw
In response to Re: Postgres gets stuck  ("Craig A. James" <cjames@modgraph-usa.com>)
List pgsql-performance
"Craig A. James" <cjames@modgraph-usa.com> 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
justwrappers around malloc() and free(), and don't (for example) make their own separate calls to brk(2), sbrk(2), or
theirkin. 

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

pgsql-performance by date:

Previous
From: "Craig A. James"
Date:
Subject: Re: Postgres gets stuck
Next
From: Bruno Wolff III
Date:
Subject: Re: [GENERAL] Arguments Pro/Contra Software Raid