improve robustness of memmgr

this (small) set of changes should make the behavior of memmgr more robust.  see the commit logs for more details.