I’m using the EasyMorph launcher on a client system. It’s been working with programs that run once a week. As soon as I add one that runs every 5 minutes, I’m seeing my memory being eaten up from 110mb to 5000mb. Memory goes up only after 5 second run from 19% to 34%. Any reason why this happens? Is there a better solution to run morph every 5 seconds?
Also why one morph cause this kind of spike after one launch?
It’s hard to say why your memory consumption goes up. Your workflow may require a lot of RAM. Windows may not release memory instantly if it thinks it will be required soon again, especially if you run it every 5 seconds.
What’s the better solution? The current morph that’s running basically pulls data from a table in sql, then filters the ltable looking for a specific ID type, and status. Once it finds rows, it calls a rest API to mail data from each row. From what I can see the job runs for no more than 5 seconds cause if there aren’t any rows, it exits. If it has rows, lets say 10, it seems to run maybe for 5 minutes or less. Any other ways to optimize?
What’s your criteria to optimize? If memory consumption increases but doesn’t keep growing after some point it’s a normal behavior. If it doesn’t stop growing and eventually leads to out of memory then send a request to our support and enclose diagnostic information.
You can also reduce memory consumption by processing smaller chunks of data at once and using iterations to process data chunk by chunk instead of processing all at once.
One more suggestion: if possible, switch from polling to event-driven processing. The latter means that instead of checking for changes every N minutes/seconds, make the source system trigger EasyMorph workflows when a change occurs.
There are a few ways how a workflow can be triggered externally:
- Execute a project from the command-line using CLW
- Trigger a Server task via an URL
- Trigger a Server task using the “ems-cmd” utility.