@lvce-editor/process-explorer 3.20.0 → 3.21.0

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/dist/index.js +3 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6379,7 +6379,7 @@ const getPsOutput = async () => {
6379
6379
  try {
6380
6380
  const {
6381
6381
  stdout
6382
- } = await execFile('ps', ['-ax', '-o', 'pid=,ppid=,pcpu=,pmem=,command=']);
6382
+ } = await execFile('ps', ['-ax', '-o', 'pid=,ppid=,pcpu=,rss=,command=']);
6383
6383
  return stdout.trim();
6384
6384
  } catch (error) {
6385
6385
  if (error && error.signal === SIGINT) {
@@ -6423,6 +6423,7 @@ const parsePsOutputLine = line => {
6423
6423
  if (pidField.value && ppidField.value && loadField.value && memoryField.value && cmd) {
6424
6424
  return {
6425
6425
  cmd,
6426
+ memory: Number.parseInt(memoryField.value) * 1024,
6426
6427
  pid: Number.parseInt(pidField.value),
6427
6428
  ppid: Number.parseInt(ppidField.value)
6428
6429
  };
@@ -6478,7 +6479,7 @@ const listProcessesWithMemoryUsage = async (rootPid, includeElectronData = true,
6478
6479
  const parsed = parsePsOutput(stdout, rootPid, pidMap);
6479
6480
  // console.timeEnd('parsePsOutput')
6480
6481
  // console.time('addAccurateMemoryUsage')
6481
- const parsedWithAccurateMemoryUsage = await Promise.all(parsed.map(addAccurateMemoryUsage));
6482
+ const parsedWithAccurateMemoryUsage = isMacOs ? parsed : await Promise.all(parsed.map(addAccurateMemoryUsage));
6482
6483
  // console.timeEnd('addAccurateMemoryUsage')
6483
6484
  const filtered = parsedWithAccurateMemoryUsage.filter(hasPositiveMemoryUsage);
6484
6485
  return filtered;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/process-explorer",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "Process Explorer",
5
5
  "main": "dist/index.js",
6
6
  "bin": "bin/processExplorer.js",