Re: Postgres gets stuck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Craig A. James" <cjames@xxxxxxxxxxxxxxxx> 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


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux