From: Darren Williams Date: Wed, 13 Apr 2005 23:18:38 GMT Subject: Re: Git usage and resource usage Message-ID: <20050413231838.GB10385@cse.unsw.EDU.AU> In-Reply-To: <20050413152948.D2442@banaan.localdomain> Hi Erik On Wed, 13 Apr 2005, Erik van Konijnenburg wrote: > On Wed, Apr 13, 2005 at 11:06:22PM +1000, Darren Williams wrote: > > Git(pasky) requires an excessive quantity of file > > descriptors, more than 1024 in a simple case and > > more than 16384 in a high workload case. > > Does this help? Posted earlier today to the list, > but since there are no archives yet its hard to find. > Yes that fixes it. % ulimit -n 1024 % quilt pop -a % time git commit ... Enter commit message, terminated by ctrl-D on a separate line: real 0m7.762s user 0m7.282s sys 0m0.459s > Regards, > Erik > > tree 70189060273990e945015845a1d97c03eac2346a > parent 97c9a63e76bf667c21f24a5cfa8172aff0dd1294 > author Erik van Konijnenburg,,, Wed Apr 13 13:32:13 2005 > committer Erik van Konijnenburg,,, Wed Apr 13 13:32:13 2005 > > avoid fd leak. > . > Index: read-cache.c > =================================================================== > --- 833bb44b8e49daf0424f44cf300748da17945859/read-cache.c (mode:100644 sha1:7cdd0f82992789e64f6ea272e43ee4af8cdf7f2a) > +++ 70189060273990e945015845a1d97c03eac2346a/read-cache.c (mode:100644 sha1:7957377f2ddd107aa686f3ca4da51b74e6679baf) > @@ -251,11 +251,15 @@ > if (fd < 0) > return -1; > map = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0); > - if (map == MAP_FAILED) > + if (map == MAP_FAILED) { > + close(fd); > return -1; > + } > if (memcmp(buf, map, size)) > return error("SHA1 collision detected!" > " This is bad, bad, BAD!\a\n"); > + munmap(map, size); > + close(fd); > #endif > return 0; > } -------------------------------------------------- Darren Williams Gelato@UNSW --------------------------------------------------