git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Cygwin can't handle huge packfiles?

From
RNRutger Nijlunsing <rutger@nospam.com>
Date
Apr 5, 2006, 23:27 UTC
Message-ID
<20060405232739.GA18121@nospam.com>
In-Reply-To
<20060405210844.GN26780@trixie.casa.cgf.cx>
On Wed, Apr 05, 2006 at 05:08:44PM -0400, Christopher Faylor wrote:
Show 16 quoted lines
> On Wed, Apr 05, 2006 at 04:14:20PM +0200, Johannes Schindelin wrote:
> >> Inspired by a patch of Alex Riesen (thanks, Alex), I tried to use the
> >> regular mmap for mapping pack files, only to discover that I compile
> >> without defining "NO_MMAP", so I've been using the stock mmap all
> >> along. So now I'm thinking that the cygwin mmap also does a
> >> malloc-and-read, just like git does with NO_MMAP. So I'll continue to
> >> investigate in that direction.
> >
> >I think cygwin's mmap() is based on the Win32 API equivalent, which could 
> >mean that it *is* memory mapped, but in a special area (which is smaller 
> >than 1.5 gigabyte). In this case, it would make sense to limit the pack 
> >size, thereby having several packs, and mmap() them as they are needed.
> 
> Yes, cygwin's mmap uses CreateFileMapping and MapViewOfFile.  IIRC,
> Windows might have a 2G limitation lurking under the hood somewhere but
> I think that might be tweakable with some registry setting.

Windows places its DLLs criss-cross through the memory space because every DLL on the system has its own preferred place to be loaded (the base address). This severely limits the amount of largest contiguous memory block available, which is needed for one mmap() I think.

Several solutions exist:
  - enlarge the address space with the /3GB boot flag in boot.ini
  - rebase all DLLs with REBASE.EXE (part of platform sdk) .
    Just make them the same and fix them to a low address.
    Problem is rebasing system dlls since those are locked by the system.
  - at start of program before other DLLs are loaded,
    reserve an as large part of the memory as possible with
    VirtualAlloc()
-- 
Rutger Nijlunsing ---------------------------------- eludias ed dse.nl
never attribute to a conspiracy which can be explained by incompetence
----------------------------------------------------------------------
Previous: Christopher FaylorNext: Christopher Faylor
Message 9 of 18 in “Cygwin can't handle huge packfiles?”
  1. Kees-Jan DijkzeulApr 3, 2006
  2. Johannes SchindelinApr 3, 2006
  3. Morten WelinderApr 3, 2006
  4. Linus TorvaldsApr 3, 2006
  5. Linus TorvaldsApr 3, 2006
  6. Kees-Jan DijkzeulApr 5, 2006
  7. Johannes SchindelinApr 5, 2006
  8. Christopher FaylorApr 5, 2006
  9. Rutger NijlunsingApr 5, 2006
  10. Christopher FaylorApr 6, 2006
  11. Junio C HamanoApr 6, 2006
  12. Junio C HamanoApr 7, 2006
  13. Jakub NarebskiApr 7, 2006
  14. Nicolas PitreApr 7, 2006
  15. Junio C HamanoApr 7, 2006
  16. Nicolas PitreApr 7, 2006
  17. Johannes SchindelinApr 3, 2006
  18. Alex RiesenApr 3, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.