systeminformation 5.31.9 → 5.31.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/memory.js +8 -2
  2. package/package.json +1 -1
package/lib/memory.js CHANGED
@@ -258,13 +258,19 @@ function mem(callback) {
258
258
  util.noop();
259
259
  }
260
260
  try {
261
- exec('vm_stat 2>/dev/null | egrep "Pages active|Pages inactive"', (error, stdout) => {
261
+ exec('vm_stat 2>/dev/null | egrep "Pages active|Pages inactive|Pages speculative|Pages wired down|Pages occupied by compressor|Pages purgeable|File-backed pages|Anonymous pages"', (error, stdout) => {
262
262
  if (!error) {
263
263
  let lines = stdout.toString().split('\n');
264
- result.active = (parseInt(util.getValue(lines, 'Pages active'), 10) || 0) * pageSize;
264
+ const wired = (parseInt(util.getValue(lines, 'Pages wired down'), 10) || 0) * pageSize;
265
+ const compressed = (parseInt(util.getValue(lines, 'Pages occupied by compressor'), 10) || 0) * pageSize;
266
+ const purgeable = (parseInt(util.getValue(lines, 'Pages purgeable'), 10) || 0) * pageSize;
267
+ const anonymous = (parseInt(util.getValue(lines, 'Anonymous pages'), 10) || 0) * pageSize;
268
+
269
+ result.active = anonymous - purgeable + wired + compressed;
265
270
  result.reclaimable = (parseInt(util.getValue(lines, 'Pages inactive'), 10) || 0) * pageSize;
266
271
  result.buffcache = result.used - result.active;
267
272
  result.available = result.free + result.buffcache;
273
+
268
274
  }
269
275
  exec('sysctl -n vm.swapusage 2>/dev/null', (error, stdout) => {
270
276
  if (!error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.31.9",
3
+ "version": "5.31.10",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",