I cannot find documentation on how numpy handles the unmapping of previously displayed memory areas: munmap for numpy.memmap() and numpy.load(mmap_mode) .
munmap
numpy.memmap()
numpy.load(mmap_mode)
I think this is only done during garbage collection, is this true?
Yes, it only closes when garbage is collected; memmap.close method does nothing.
memmap.close
You can call x._mmap.close() , but keep in mind that any further access to the x object will cause python to crash.
x._mmap.close()
x