hg pull runs out of memory

Matt Mackall mpm at selenic.com
Wed Apr 25 18:20:26 UTC 2012


On Wed, 2012-04-25 at 14:40 +0200, Hertroys A. wrote:
> Or perhaps I need more memory than our (mainly 32-bit) systems can
> address, in which case my options are limited to a few production
> servers :(

Indeed. When running a 32-bit version of Mercurial, the effective file
size limit is about 400MB, no matter how much memory you throw at the
machine.

Start with 4G of address space (not RAM!). Divide by 2: 2G for the
kernel and 2G for the application. Now that 2G is already chopped up
into pieces by where the kernel decides to place the application and all
its libraries in memory. You're lucky at this point if you can get a
single 400MB piece.. and Mercurial needs a few.

No amount of additional RAM or swap will help.

> Why does Mercurial need that much memory to pull in a binary file
> anyway? There doesn't seem to be any benefit in keeping it in memory.
> Can that be prevented somehow, perhaps (after they've been added to
> the repo, obviously)?

Because Mercurial is designed for dealing with _source code_ quickly.
And it's massively more efficient to deal with small files typical of
source code by reading, writing, and calculating deltas on them in
memory.

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list