Shared Memory Modules

Scott David Daniels Scott.Daniels at Acm.Org
Mon Dec 1 18:07:02 EST 2003


Irmen de Jong wrote:
> However, I've just tried it, and managed to crash Python in mmap.pyd
> with an application exception... twice. But trying to reproduce it
> now fails-- Python keeps running.
> I did this:
>  >>> import mmap
>  >>> mem=mmap.mmap(0,3000000,'irmen')
>  >>> mem[0]='a'
>  >>> mem[2000000]='a'
> and initially, it crashed......... Python 2.3.2 on win xp)
> --Irmen

Probably not enough actual memory hanging around.  Some systems
(and from this I'd guess XP) allocate virtual memory by reserving
address space, not actually allocating the RAM and/or backing
store for that memory.  Python has no control over this, and you
have nothing good to do if the memory is over-allocated.  When
you create the memory, you could walk across it writing into it
(forcing it to exist), but that would just force the failure to
happen earlier.


-Scott David Daniels
Scott.Daniels at Acm.Org





More information about the Python-list mailing list