Wrap the malloc/free calls to track how much memory is allocated. It's possible that tcmalloc and/or jemalloc will provide callbacks to enable this type of support. Likely will need multiple implementations. This functionality will be similar to issue #137.