Memory logger improvements
The memory logger is not good at handling high frequency calls, producing large memory dumps that are impossible (almost) to process. The allocation and deallocation of the sort arrays is a particular issue. We need to do a better job.