Welcome to the Linux Foundation Forum!

Lab 14.2 error?

'use strict'
setTimeout(() => {
  console.log() // TODO output uptime of process
  console.log() // TODO output uptime of OS
  console.log() // TODO output total system memory
  console.log() // TODO output total process memory
}, 1000)

for this exercise this particular line:

console.log() // TODO output total process memory

throws an assertion error when I log

process.memoryUsage().rss

Although it works when I use.

process.memoryUsage().heapTotal

My understanding is that the heapTotal is not the total process memory.
I think that the rss includes heapTotal and external memory for both the V8 and c++ memory usage. While heapTotal only represents V8 memory usage.

Am I wrong or is there an error in the test?

Best Answer

  • davidmarkclements
    davidmarkclements Posts: 158
    Accepted Answer

    hey @andrewpartrickmiller you're not wrong - I was using process in a slightly different (less correct) way to refer to just the JS portion. I've improved the wording by changing the word "process" to "heap". Thanks for the feedback Andrew!

Categories

Upcoming Training