1

Sometimes when I run this command npx hardhat compile on my windows cli I get the error below:

Compiling 72 files with 0.7.0
contracts/libraries/ERC20.sol: Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: <SPDX-License>" to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. 
Please see https://spdx.org for more information.

contracts/libraries/ERC1155/EnumerableSet.sol:158:5: Warning: Variable is shadowed in inline assembly by an instruction of the same name    
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
    ^ (Relevant source part starts here and spans across multiple lines).

contracts/libraries/ERC1155/EnumerableSet.sol:224:5: Warning: Variable is shadowed in inline assembly by an instruction of the same name    
    function add(AddressSet storage set, address value) internal returns (bool) {
    ^ (Relevant source part starts here and spans across multiple lines).

Compiling 1 file with 0.8.0

<--- Last few GCs --->

[8432:042B0460]   263058 ms: Mark-sweep (reduce) 349.8 (356.3) -> 248.2 (262.4) MB, 434.4 / 0.2 ms  (+ 70.9 ms in 3 steps since start of marking, biggest step 69.6 ms, walltime since start of marking 800 ms) (average mu = 0.989, current mu = 0.990) memory[8432:042B0460]   263627 
ms: Mark-sweep (reduce) 248.2 (259.4) -> 248.2 (252.1) MB, 555.5 / 0.0 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 556 ms) (average mu = 0.969, current 
mu = 0.023) memory p

<--- JS stacktrace --->

FATAL ERROR: NewNativeModule Allocation failed - process out of memory`

After some time the error just kind of goes away.

It goes away probably after I've restarted my system or created a new Hardhat project and imported the code there.

But this is happening too often, what could be the cause?

I've done quite some research and some answers suggested it might be a problem with Node and the application's memory allocation, but I don't know how I would apply the solutions to a Hardhat project.

Here is a link to one possible solution: https://medium.com/@vuongtran/how-to-solve-process-out-of-memory-in-node-js-5f0de8f8464c

OS: WINDOWS 10
CLI: WINDOWS CMD

Jasperan
  • 2,154
  • 1
  • 16
  • 40
KelvinIOT
  • 325
  • 1
  • 2
  • 14

0 Answers0