VanityEth icon indicating copy to clipboard operation
VanityEth copied to clipboard

fixed high memory usage

Open pk910 opened this issue 1 year ago • 3 comments

I've implemented a fix for #39 as I ran into the same problem. The underlying problem for this high memory consumption is, that nodejs only runs its garbage collector as a subtask. This subtask is never executed when running a endless loop.

To resolve the issue I've changed the worker implementation to run via a interval instead of a blocking while(true) loop. The VanityEth.getVanityWallet now stops after a given amount of time, so it's not blocking forever, but gets recalled from the interval almost immediately.

I'm running it on a server for a few hours now. It's consuming max CPU, but doesn't go above ~70MB memory anymore :)

pk910 avatar May 04 '23 04:05 pk910