Hi Everyone!
I wanted to share a lightweight solution I created to check memory consumption for a specific process.
In my use case, the application being automated is notorious for having memory leaks resulting in inconsistent crashes and freezes once the consumed memory grows.
Before developing the custom script and logic, I tried to limit the number of transactions in a given run but this resulted in having to schedule automation triggers more frequently. The results were inconsistent and required some reworking of the dispatcher logic to ensure transaction were not being duplicated or missed.
This repo contains a workflow and the script used in the invoke code to find the process belonging to the current user. We then check to see if the memory consumed (in GB) is larger than the threshold we have set. If it is, then we pass in the process object and kill it using kill process.
As far as I am aware, there was not another way to accomplish this. But happy to hear if there are other ways to solve this problem and if you have run into it yourself!