using mmap on large (> 2 Gig) files

"Martin v. Löwis" martin at v.loewis.de
Tue Oct 24 13:29:57 EDT 2006


sturlamolden schrieb:
> Martin v. Löwis wrote:
> 
>> What architecture are you on? On a 32-bit architecture, it's likely
>>  impossible to map in 2GiB, anyway (since it likely won't fit into
>> the available address space).
> 
> Indeed. But why does Python's memory mapping need to be flushed?

It doesn't need to, why do you think it does?

> And why doesn't Python's mmap take an offset argument to handle large
> files?

I don't know exactly; the most likely reason is that nobody has
contributed code to make it support that. That's, in turn, probably
because nobody had the problem yet, or nobody of those who did
cared enough to implement and contribute a patch.

> Is Python actually memory mapping with mmap or just faking it
> with fseek?

Read the source, Luke. It uses mmap or MapViewOfFile, depending
on the platform.

Regards,
Martin



More information about the Python-list mailing list