It can happen that the call to GDKreallocmax in HEAPextend fails.  What then happens is that it is tried to allocate a heap using a memory mapped file after which the original heap data is copied to the memory mapped area and the old heap freed (this presumably to save the cost of I/O).  This in the supposition that even if the malloc arena is full, memory mapping of files can still work because it uses a different address range.  This appears to not always be the case.  What I added if the above procedure fails is to first save and free the old heap, and then reloading it using a memory mapped file.  If that also fails, all hope is lost.
It can happen that the call to GDKreallocmax in HEAPextend fails.  What
then happens is that it is tried to allocate a heap using a memory
mapped file after which the original heap data is copied to the memory
mapped area and the old heap freed (this presumably to save the cost of
I/O).  This in the supposition that even if the malloc arena is full,
memory mapping of files can still work because it uses a different
address range.  This appears to not always be the case.  What I added if
the above procedure fails is to first save and free the old heap, and
then reloading it using a memory mapped file.  If that also fails, all
hope is lost.

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb