Open fvictorio opened 1 year ago
Issue ("JavaScript heap out of memory") still persists when running hardhat coverage
.
Started happening after updates to the below versions.
Versions: "solidity-coverage": "0.8.12" "hardhat": "2.22.5"
Adding export NODE_OPTIONS=--max-old-space-size=4096
before running hardhat coverage
produces Killed
output instead of heap out of memory
. Not sure this is the right solution though.
Does it also fail if you only upgrade hardhat and not solidity-coverage?
Does it also fail if you only upgrade hardhat and not solidity-coverage?
Thanks for the suggestion! Tried this now and don't seem to fail so far, but it's not a full run of all contracts at this time. Will keep working and get back on this.
After adding all the tests back, I am still getting the same error.
Hi @Whytecrowe, (I help maintain solidity-coverage)
Is it possible to increase your memory allocation to 8192
and see if it works / the mem usage is bounded?
- export NODE_OPTIONS=--max-old-space-size=4096
+ export NODE_OPTIONS=--max-old-space-size=8192
You may also be able to reduce the plugin's runtime memory footprint by setting the measureStatementCoverage
option to false
in .solcover.js
.
There's more info about this in the plugin's FAQ at the link below:
Hey @cgewecke , thank you for your answer.
I have tried both methods, and the issue still persists.
When I enlarge old space size, instead of "heap out of memory" I just get a single word message - "Killed", but the coverage test fails at the same place. Adding measureStatementCoverage
flag didn't help either. I went through the FAQ, but none of it seems to help.
We do not have any new contracts, just updated OZ packages, but the amount of contracts stayed the same, and before, with older Hardhat and OZ contracts we haven't had any issues.
Is there anything else that may help here?
@Whytecrowe Commented in your PR here:
https://github.com/zer0-os/zNS/pull/109
It looks like the issue is tied to a stress test using a huge (100k chars) string. Maybe there's a memory problem somewhere in EDR when the vm step listener is attached and there's a huge transaction frame or something?
@Whytecrowe Commented in your PR here:
https://github.com/zer0-os/zNS/pull/109
It looks like the issue is tied to a stress test using a huge (100k chars) string. Maybe there's a memory problem somewhere in EDR when the vm step listener is attached and there's a huge transaction frame or something?
I just tried this before your message, and it worked. The link on how to skip it for coverage only is super helpful. Thank you for all the help!
We know that there are memory leaks when snapshots are used, but we should do a proper profiling of how Hardhat's memory usage behaes in different scenarios.
Marking this as blocked until rethnet, because it doesn't make sense to invest time in this before that.
Related issues:
3016.
3346
hh node
crashes with up to 8 GB of--max-old-space-size
. Using 16 GB works, but that's insane.1648
868