Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc
Date
Msg-id 199905100058.JAA00486@ext16.sra.co.jp
Whole thread Raw
In response to Re: [HACKERS] Re: SIGBUS in AllocSetAlloc & jdbc  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > Possible solutions might be:
> > (1) do a context switching in lo_read/lo_write
> 
> I agree with this, but I worry a little bit about memory leakage,
> because anything allocated in GlobalMemoryContext is not going to get
> cleaned up automatically.  If lo_read/lo_write call any code that is
> sloppy about pfree'ing everything it palloc's, then you'd have a
> long-term leakage that would eventually make the backend run out of
> memory.  But it'd be easy enough to test for that, if you have a test
> app that can run the backend through a lot of LO calls.

Yes, I thought about that too. Maybe we could destroy the
GlobalMemoryContext in lo_close() if no LO descriptor exists any more.
Of course this would not prevent the memory leakage if a user forget
to call lo_close, but it's of the user's responsibility anyway.
---
Tatsuo Ishii


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] parser enhancement request for 6.5
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] vacuum slowness