More improvements to memory handling

Authored by mutlaqja on Jan 9 2020, 11:07 AM.