function
jsc.estimateShallowMemoryUsageOf
value: string | bigint | symbol | object | CallableFunction
): number;
Non-recursively estimates the memory usage of an object, excluding the memory usage of properties or other objects it references. For more accurate per-object memory usage, use Bun.generateHeapSnapshot.
The estimate is best-effort. When it's wrong, the memory may be non-contiguous (such as a large array).
Passing a primitive type that isn't heap allocated returns 0.