Sometimes when i run `npx hardhat compile` i get this error: FATAL ERROR: NewNativeModule Allocation failed - process out of memory

Sometimes when i run this command npx hardhat compile on my windows cli i get the error below
screenshot of error

After sometime 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 dont know how i would apply the solutions to a Hardhat project.

Here is a link to one possible solution: