MemoryError

Matt Mackall mpm at selenic.com
Mon Nov 5 20:48:10 UTC 2012


On Mon, 2012-11-05 at 16:35 +0100, Angel Ezquerra wrote:
> Hi,
> 
> a colleague of mine just had a problem when committing a pretty large
> binary file (260 MB). At first he was not able to commit (hg returned error
> code 255). In the end he was able to successfully commit (I believe he
> created a brand new repository and tried again). However, now he is not
> able to update to that revision.
> 
> Running "hg verify --verbose" returns:
> 
>     C:\scb\prueba>hg verify --verbose
>     repository uses revlog format 1
>     checking changesets
>     checking manifests
>     crosschecking files in changesets and manifests
>     checking files
>     MCRInstaller.exe at 0: unpacking 63e2441ad980: MemoryError()
>     12 files, 1 changesets, 12 total revisions
>     1 integrity errors encountered!
>     (first damaged changeset appears to be 0)
> 
> Apparently mercurial is unable to unpack the file due to memory problems.

Yep.

> His PC is running WindowsXP 32bit, and it only has 2 GB of ram. However the
> Windows Task Admin shows that he has 1.13 GB free (I attach a picture
> showing it, but it is in Spanish. "Disponible" means "Available").
> 
> [image: Inline image 1]
> 
> Does this error make sense? I believed that mercurial needed twice as much
> free memory as the size of the biggest file. If that is the case it seems
> that is computer should have enough memory to handle this file.

Mercurial itself uses _3x_ in its warning on large files. That number is
pretty solid for small files, but it turns out to be fairly optimistic
on the large end, due to the implementation details of the platform's
memory allocators and virtual address space fragmentation. So, no, I
can't say I'm surprised this didn't work.


Consider enabling swap. Then expect to run into further difficulties at
file sizes around 400MB that can only be fixed by moving to 64-bit (or
Linux).

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list