Unmap from NumPy memmap

I cannot find documentation on how numpy handles the unmapping of previously displayed memory areas: munmap for numpy.memmap() and numpy.load(mmap_mode) .

I think this is only done during garbage collection, is this true?

+8
python numpy mmap
source share
1 answer

Yes, it only closes when garbage is collected; memmap.close method does nothing.

You can call x._mmap.close() , but keep in mind that any further access to the x object will cause python to crash.

+7
source share

All Articles