Fix MemoryLeaks test
Previously, we measured the size of the entire IWorld to check if memory usage increased. This gives flaky results, because it includes share names. Share names in these examples include TaskIds, which are incremented, so slowly the share names become bigger. Using copy_to_string, strings are padded to 4 or 8 bytes, depending on the platform (32-bit or 64-bit). Because the share names also include the path, the tests could fail on some systems in some paths, but not on others (although the tests were always more likely to fail on 32-bit systems).
With this commit, we measure the size of the share values ignoring
their names. Because Map
is fully strict, the fold does not alter
evaluation order and this is safe.