Re: [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory
Date
Msg-id 200506050340.j553emJ06333@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory leak)  (ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp>)
Responses Re: [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory
Memory leak in BootStrapXLOG()
List pgsql-patches
ITAGAKI Takahiro wrote:
> Hello everyone.
>
> I fixed two bugs in the patch that I sent before.
> Check and test new one, please.
>
> 1. Fix update timing of Write->curridx. (pointed by Tom)
>      Change to update it soon after write().
>
> 2. Fix buffer alignment routine on 64bit cpu. (pointed by Mark)
>      I checked it on Xeon EM64T and it worked properly, but I don't have IA64...
>
>
> BTW, I found memory leak in BootStrapXLOG(). The buffer allocated by malloc()
> is not free()ed. ISSUE_BOOTSTRAP_MEMORYLEAK in this patch points out it.
> (But this leak is not serious, because this function is called only once.)

Does the following patch fix the memory leak you described?

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073
Index: src/backend/access/transam/xlog.c
===================================================================
RCS file: /cvsroot/pgsql/src/backend/access/transam/xlog.c,v
retrieving revision 1.195
diff -c -c -r1.195 xlog.c
*** src/backend/access/transam/xlog.c    2 Jun 2005 05:55:28 -0000    1.195
--- src/backend/access/transam/xlog.c    5 Jun 2005 03:38:23 -0000
***************
*** 3754,3759 ****
--- 3754,3760 ----
      BootStrapCLOG();
      BootStrapSUBTRANS();
      BootStrapMultiXact();
+     free(buffer);
  }

  static char *

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] WAL: O_DIRECT and multipage-writer (+
Next
From: Christopher Kings-Lynne
Date:
Subject: Re: [HACKERS] Implementing RESET CONNECTION ...