facebook / memlab

A framework for finding JavaScript memory leaks and analyzing heap snapshots
https://facebook.github.io/memlab/
MIT License
4.35k stars 118 forks source link

memlab run --scenario results in a bad state #29

Closed wctiger closed 1 year ago

wctiger commented 1 year ago

I am running the tool following the documentation, but the runs ended in a bad state - retried a few times but still same results.

$ memlab run --scenario dv-report-explorer.js
'command' is not recognized as an internal or external command,
operable program or batch file.
page-load[35.9MB](baseline)[s1] > action-on-page[34.5MB](target)[s2] > revert[34.7MB](final)[s3]

total time: 1.9min
Memory usage across all steps:
LIBERTY LIBERTY LIBERTY
LIBERTY LIBERTY LIBERTY
LIBERTY LIBERTY LIBERTY
                                   !             H|H|H|H|H           H__________________________________             H|§|§|§|H           H|* * * * * *|---------------------|             H|§|∞|§|H           H| * * * * * |---------------------|             H|§|§|§|H           H|* * * * * *|---------------------|             H|H|H|H|H           H| * * * * * |---------------------|             H|H|H|H|H           H|---------------------------------|          ===============        H|---------------------------------|            /| _   _ |          H|---------------------------------|            (| O   O |)          H|---------------------------------|            /|   U   |          H-----------------------------------             |  =/  |           H              _..._/            H              _|I/|_            H      _______/| H |/_______    H     /           / /          H    |          | | /         |  H    |          ||o||          |  H    |    |     ||o||     |    |  H    |    |     ||o||     |    |  H   Carl Pilcher
test ing testi ng tes ting te sti ng test ing t estin g testin

OS: Windows 10.0.19044 Node: 16.14.0

$ memlab version

 memlab@1.1.28
 @memlab/heap-analysis@1.0.9
 @memlab/e2e@1.0.12
 @memlab/core@1.1.11
 @memlab/cli@1.0.14
 @memlab/api@1.0.11
JacksonGL commented 1 year ago

@wctiger Were you running in cmd, powershell or git bash? Is this memlab command from a npm install or built from the Git repo?

wctiger commented 1 year ago

@wctiger Were you running in cmd, powershell or git bash? Is this memlab command from a npm install or built from the Git repo?

I did try powershell and git bash, both with same results. I'm running it after an npm install -g.

JacksonGL commented 1 year ago

@wctiger I tried memlab (in Git Bash and powershell on Windows), but I wasn't able to reproduce the error you had. Can you share a screenshot?

wctiger commented 1 year ago

Hi @JacksonGL looks like I hit this issue here https://github.com/Marak/colors.js/issues/289.

A look in npm ls shows the broken version comes from babar 0.2.3:

PS C:\Users\username\AppData\Roaming\npm\node_modules\memlab> npm ls colors
memlab@1.1.28 C:\Users\username\AppData\Roaming\npm\node_modules\memlab
`-- babar@0.2.3
  `-- colors@1.4.2

After a closer look I found the problem - I was running npm install behind a mirrored npm repository and it hasn't updated to remove the corrupted colors versions 1.4.2. Thanks for checking this, I think I am good now.