You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wasn't around when clinic heapprofiler was created so I don't know exactly if that's the expected behaviour. I'm guessing heapprofiler does count the amount of memory allocation during the profile while the process.memoryUsage().heapUsed gets the whole process memory (heap) used -- it's different because the process might hold 10mb but just allocate 1mb in objects.
I should have mentioned when I wrote this that --runInBand doesn't change the situation; I suspect it's something to do with the fact that node kicks off a child process. Here's the process tree, as reported by htop during a test run:
You can see there that the main jest process only has 86mb, while its child test-runner process is chomping up an order of magnitude more memory.
Expected Behavior
Current Behavior
Steps to Reproduce (for bugs)
--logHeapUsage
:clinic doctor -- node node_modules/.bin/jest --logHeapUsage packages/models/__tests__/project
PASS models packages/models/__tests__/project/model.test.ts (10.117 s, 469 MB heap size)
What could be causing such a large difference? Jest uses
process.memoryUsage().heapUsed
to measure the heap size.Sample upload
I don't feel comfortable uploading my work app's trace, unfortunately
Environment
The text was updated successfully, but these errors were encountered: