The libuv library provides a way to replace the default allocator with user supplied allocator (malloc, realloc, calloc and free). Create a memory context specifically for libuv to allow tracking the memory usage that has originated from within libuv. This requires libuv >= 1.38.0 which provides uv_library_shutdown() function that assures no more allocations will be made.