HPCC-12723 Optimize memory manager using the new functions

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Merge pull request #6756 from ghalliday/issue12723

HPCC-12723 Optimize memory manager using the new functions

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>