Re: Memory use in 8.3 plpgsql with heavy use of xpath() - Mailing list pgsql-general

From Matt Magoffin
Subject Re: Memory use in 8.3 plpgsql with heavy use of xpath()
Date
Msg-id 49295.192.168.1.1.1215331338.squirrel@msqr.us
Whole thread Raw
In response to Re: Memory use in 8.3 plpgsql with heavy use of xpath()  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Memory use in 8.3 plpgsql with heavy use of xpath()  ("Matt Magoffin" <postgresql.org@msqr.us>)
List pgsql-general
> Gregory Stark <stark@enterprisedb.com> writes:
>> That's just a special case of what would be expected to happen with
>> memory
>> allocation anyways though. Few allocators return memory to the OS
>> anyways.
>
> Well, that does happen on Linux for instance.  Since Matt knew in his
> original report that the xpath leak was intra-transaction, I assumed
> he must be using a platform where malloc/free can release memory back
> to the OS --- else he couldn't have seen that behavior from outside
> the backend.
>
> Still, it's entirely possible that some sort of high-water-mark is
> involved somewhere, perhaps in malloc's internal data structures.

I was really going on a hunch, as I noticed a definite trend of postgres
processes using more and more memory over time, and it only started after
switching to 8.3 and starting to use xpath() quite heavily. Most of the
memory data I have comes from Linux x64 systems with Postgres compiled as
64-bit. But I did also notice what appeared to be a similar trend on an OS
X PPC system.

In any event, I'm sorry I can't provide any more helpful tests, but I'll
report back how the system changes after I've patched these systems.

-- m@

pgsql-general by date:

Previous
From: Sheikh Salman Ahmed
Date:
Subject: Query Problem
Next
From: "Dave Page"
Date:
Subject: Re: Query Problem