Ok, 

I think large objects are leaking memory because the large object functions
in the backend use their own GlobalMemoryContext (called Filesystem), which
(according to a quick grep) is never freed.

Supposing this is true and I ensure that the large object subsystem always
uses the current memory context for it's memory allocations.

What might go wrong? (Or why did the designers decide to use a
GlobalMemoryContext for large objects?).

I simple don't understand why one would create a special memory context
for large objects without some special reason. 
Or should I just try it and see is anything breaks?

Thanks for any comments.
Maurice



Mon, 16 Feb 1998 16:54:05 +0100
"Maurice Gittens" <mgittens@gits.nl>
Memory leaks for large objects
On Mon, 16 Feb 1998, Maurice Gittens wrote:

> Ok, 
> 
> I think large objects are leaking memory because the large object functions
> in the backend use their own GlobalMemoryContext (called Filesystem), which
> (according to a quick grep) is never freed.
> 
> Supposing this is true and I ensure that the large object subsystem always
> uses the current memory context for it's memory allocations.
> 
> What might go wrong? (Or why did the designers decide to use a
> GlobalMemoryContext for large objects?).
> 
> I simple don't understand why one would create a special memory context
> for large objects without some special reason. 
> Or should I just try it and see is anything breaks?

I was wondering the same thing when I was looking at that part of the code
a couple of months back. It would be interesting to see if anything did
break.

-- 
Peter T Mount  petermount@earthling.net or pmount@maidast.demon.co.uk
Main Homepage: http://www.demon.co.uk/finder
Work Homepage: http://www.maidstone.gov.uk Work EMail: peter@maidstone.gov.uk


Tue, 17 Feb 1998 21:10:17 +0000 (GMT)
Peter T Mount <psqlhack@maidast.demon.co.uk>
Re: [HACKERS] Memory leaks for large objects
Peter T Mount wrote:

> On Mon, 16 Feb 1998, Maurice Gittens wrote:
>
> > Ok,
> >
> > I think large objects are leaking memory because the large object functions
> > in the backend use their own GlobalMemoryContext (called Filesystem), which
> > (according to a quick grep) is never freed.
> >
> > Supposing this is true and I ensure that the large object subsystem always
> > uses the current memory context for it's memory allocations.
> >
> > What might go wrong? (Or why did the designers decide to use a
> > GlobalMemoryContext for large objects?).
> >
> > I simple don't understand why one would create a special memory context
> > for large objects without some special reason.
> > Or should I just try it and see is anything breaks?
>
> I was wondering the same thing when I was looking at that part of the code
> a couple of months back. It would be interesting to see if anything did
> break.

Does the large object I/O persist across transactions? If so, then storage would
need to be outside of the usual context, which is reset after every transaction.
Is there a place where the large object context could be freed, but is not at
the moment?

                                                          - Tom


Wed, 18 Feb 1998 06:54:18 +0000
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Re: [HACKERS] Memory leaks for large objects