Deno.memoryUsage is returning heapTotal > resident set size (rss)

I’m currently having an issue where the rss returned from Deno.memoryUsage (across applications) is returning an rss size that is less than the heapTotal. This is an issue that just started in the past few days. Rss starts higher in some applications and then crosses below heapTotal in those applications. This is consistent across all Deno applications, regardless of any other frameworks used.

I’m using the Deno v. 1.27.2 on all the applications. This is an issue across multiple applications, computers, and developers (I’m working with a small team) and not specific to any particular tech stack.

My understanding based on every article I’ve read and from the Deno docs is that rss should represent the total memory of the process in RAM. It should include both the heapTotal and heapUsed and the call stack. My understanding is that it should never fall below heapTotal. This is the diagram I’ve seen everywhere:
A diagram of memory in a JavaScript runtime environment

Does anyone have any insight into this? Am I misunderstanding the resident set size (rss) entirely? Is the rss different in Deno than in Node?

What we’ve tried:

I’ve dug into the rust source code for Deno and found that they are using this rust function to measure the resident-set-size:

pub fn total_physical_size(&self) -> usize {
   unsafe { v8__HeapStatistics__total_physical_size(self) }
}

Which retrieves the total_heap_size() from the v8 engine.

When we sampled the memory statistics after discovering the bug, we used the following function and ran it on multiple applications, always receiving the same result:

setInterval(() => {
   console.log(Deno.memoryUsage());
}, 500)

Here is a sampling of values we have received from one of our applications.

{ rss: 4423680, heapTotal: 4849664, heapUsed: 3894252, external: 29347 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3906964, external: 33617 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3919676, external: 37887 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3932388, external: 42157 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3945100, external: 46427 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3957812, external: 50697 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3970524, external: 54967 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3983236, external: 59237 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3995948, external: 63507 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4008660, external: 67777 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4021372, external: 72047 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4034084, external: 76317 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4046796, external: 80587 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4059508, external: 84857 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4072220, external: 89127 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4084932, external: 93397 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4097644, external: 97667 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 4110356, external: 101937 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4123088, external: 106209 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4135804, external: 110481 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4148520, external: 114753 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4161236, external: 119025 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4173952, external: 123297 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4186668, external: 127569 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4199384, external: 131841 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4212100, external: 136113 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4224816, external: 140385 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4237532, external: 144657 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4250248, external: 148929 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4262964, external: 153201 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4275680, external: 157473 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4288396, external: 161745 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4301112, external: 166017 }
{ rss: 4669440, heapTotal: 4849664, heapUsed: 4313828, external: 170289 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3869548, external: 20807 }
{ rss: 4423680, heapTotal: 4849664, heapUsed: 3882260, external: 25077 }