HPCC-12723 Optimize memory manager using the new functions

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>