Re: [PATCHES] [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory

2005-06-06 Thread Tom Lane
Bruce Momjian  writes:
> Tom Lane wrote:
>> You realize this is a waste of code, no?

> I guess, but the person reported a leak so I figured I would fix it.

I don't really care whether there's a free() there or not --- what
bothers me is that calling it a leak shows a fundamental
misunderstanding of the environment in which that code runs, which
is likely to lead to proposed changes that have less trivial
consequences.

regards, tom lane

---(end of broadcast)---
TIP 6: Have you searched our list archives?

   http://archives.postgresql.org


Re: [PATCHES] [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory

2005-06-06 Thread Bruce Momjian
Tom Lane wrote:
> Bruce Momjian  writes:
> >> 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?
> 
> You realize this is a waste of code, no?  It's not like the bootstrap
> subprocess frees every single bit of memory it ever allocates, and even
> less like it'd be profitable to try to make it do so ... the memory
> will go away anyway when the subprocess exits.

I guess, but the person reported a leak so I figured I would fix it.

-- 
  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

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


Re: [PATCHES] [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory

2005-06-04 Thread Tom Lane
Bruce Momjian  writes:
>> 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?

You realize this is a waste of code, no?  It's not like the bootstrap
subprocess frees every single bit of memory it ever allocates, and even
less like it'd be profitable to try to make it do so ... the memory
will go away anyway when the subprocess exits.

regards, tom lane

---(end of broadcast)---
TIP 7: don't forget to increase your free space map settings


Re: [PATCHES] [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory

2005-06-04 Thread Bruce Momjian
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 -   1.195
--- src/backend/access/transam/xlog.c   5 Jun 2005 03:38:23 -
***
*** 3754,3759 
--- 3754,3760 
BootStrapCLOG();
BootStrapSUBTRANS();
BootStrapMultiXact();
+   free(buffer);
  }
  
  static char *

---(end of broadcast)---
TIP 4: Don't 'kill -9' the postmaster


Re: [PATCHES] [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory leak)

2005-03-01 Thread Mark Wong
On Thu, Feb 03, 2005 at 07:25:55PM +0900, ITAGAKI Takahiro wrote:
> Hello everyone.
> 
> I fixed two bugs in the patch that I sent before.
> Check and test new one, please.

Ok, finally got back into the office and was able to run 1 set of
tests.

So the new baseline result with 8.0.1:
http://www.osdl.org/projects/dbt2dev/results/dev4-010/309/
Throughput: 3639.97

Results with the patch but open_direct not set:
http://www.osdl.org/projects/dbt2dev/results/dev4-010/308/
Throughput: 3494.72

Results with the patch and open_direct set:
http://www.osdl.org/projects/dbt2dev/results/dev4-010/312/
Throughput: 3489.69

You can verify that the wall_sync_method is set to open_direct under
the "database parameters" link, but I'm wondering if I missed
something.  It looks a little odd the the performance dropped.

Mark

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]


Re: [PATCHES] [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory

2005-02-14 Thread Bruce Momjian

This has been saved for the 8.1 release:

http://momjian.postgresql.org/cgi-bin/pgpatches2

---

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.)
> 
> 
> ITAGAKI Takahiro

[ Attachment, skipping... ]

> 
> ---(end of broadcast)---
> TIP 7: don't forget to increase your free space map settings

-- 
  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

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])


Re: [PATCHES] [HACKERS] WAL: O_DIRECT and multipage-writer (+ memory leak)

2005-02-03 Thread ITAGAKI Takahiro
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.)


ITAGAKI Takahiro


xlog.c.diff
Description: Binary data

---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropriate
  subscribe-nomail command to [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly