[polyml] measuring/profiling memory consumption