Skip to content

Incorrect vsize value #47

@ev0rtex

Description

@ev0rtex

I am noticing terribly incorrect vsize values on my system (Ubuntu Server 14.04). For an example I have a simple js file where I do:

var usage = require('usage');

usage.lookup(process.pid, function(err, stats) {
  console.log(stats);
});

In the output I see:

{ memory: 16662528,
  memoryInfo: { rss: 16662528, vsize: 2805502836736 },
  cpu: 89.99999999476131,
  cpuInfo:
   { pcpu: 89.99999999476131,
     pcpuUser: 29.999999998253767,
     pcpuSystem: 59.99999999650753,
     cpuTime: undefined } }

That is giving me a vsize of 2.55TB. There is no way that makes sense.

Digging through the code I see that in lib/providers/linux.js it is multiplying the vsize it gets from /proc/[pid]/stat by the PAGE_SIZE. In the proc man page it says:

    vsize %lu   (23) Virtual memory size in bytes.

Seems to me that what I actually want is that raw vsize value without the multiplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions