mmap caching

"Martin v. Löwis" martin at
Sun Jan 21 22:38:21 CET 2007

George Sakkis schrieb:
> I've been trying to track down a memory leak (which I initially
> attributed erroneously to numpy) and it turns out to be caused by a
> memory mapped file. It seems that mmap caches without limit the chunks
> it reads, as the memory usage grows to several hundreds MBs according
> to the Windows task manager before it dies with a MemoryError.

You must be misinterpreting what you are seeing. It's the operating
system that decides what part of a memory-mapped file are held in
memory, and that is certainly not without limits.

Notice that there are several values that can be called "memory
usage" (such as the size of the committed address space, the working
set size, etc); you don't mention which of these values grows several
hundreds MB.


More information about the Python-list mailing list