There are many options for heap profiling in NodeJS, but I’m having trouble finding anything to profile the memory returned by process.memoryUsage().arrayBuffers
.
So far the only approach I’ve found is to “patch” Buffer.alloc
, Buffer.allocUnsafe
, Buffer.from
to track allocations, along with FinalizationRegistry
to track deallocations. However, I’m still only getting to around 30% of my “arrayBuffers” usage, and want to find the other sources of allocations.
I can try to find all the other functions allocating buffer memory, such as all the typed array constructors, but is there any better way to do this?