If you have a very intensive methods taht could potentielly lead to an out of memory, you should always call it with noRetry: true.
If you don’t do this, restarting your server will not help you.
Another solution is to move intensive methods on a job queue on another server that doesn’t affect the main servers accessed by users. This way, you can minimize affecting users of your app because of these methods