HPCC-12708 Optimize memory manager using the new functions

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