[Numpy-discussion] how-to "put" RAM-based numarray into memmap
Todd Miller
jmiller at stsci.edu
Mon Nov 24 13:19:04 EST 2003
> Thanks for your reply.
> Is it possible to define a memmap slice and giving it a (preinitialized !)
> memory buffer ?
It should be now. I just added support for a "buffer" parameter to
CVS. I tested it manually and it worked OK for me; please try it out
or watch for it in numarray-0.8.
> I'm thinking: I have a RAM-based numarray, I just take the buffer (pointer)
> and hand it over to the memmap-slice so that it can make the association
> between the disk-space and the RAM-space.
> I guess you are calling "heap" what I call RAM. Is memmap using something
> inherently different that heap? (I might be missing something...)
Yes and no. When you allocate a slice of an existing memmap, you're
getting memory backed on the disk file of your choice; mapped memory
generally comes from a different address partition than the memory from
malloc(). When you allocate memory using numarray, or insert a slice
into a memmap without specifying the buffer, you're getting memory from
the heap which is backed on the system swap file. (Of course, this
varies a little by system as well; I'm thinking Linux/UNIX here and
Win32 may be slightly different).
Todd
--
Todd Miller <jmiller at stsci.edu>
More information about the NumPy-Discussion
mailing list