Aw Snap Memory errors in Chrome when running web based automations

Why "Aw, snap!" or memory error appear when running automations in Chrome browser?

Issue:

When the bots are executing long running processes and huge number of transactions at some point the job fails with either memory error or "Aw, snap!" browser error.

Resolution:

When getting the "Aw, Snap" error or another error code instead of a webpage, Chrome is having problems loading. Sometimes the page loads slowly or does not open at all.

This issue occurs when the process runs for a long time and the browser cache increases and crashes.

A couple of troubleshooting steps that could help in this scenario are:

  1. Reload the page.
  2. Wait for the issue to occur, handle the exception, close the browser, and open the browser. Ensure the status of the failed transaction is retried.
  3. After every few hundred or thousand records are processed, close and open the browser.
  4. Build a script that deletes cache and cookies for All time when the error occurs; execute the script.
  5. After executing it, the browser needs to be restarted.