1) By Archiving a process will there be considerable impact on memory consumptio

1) By Archiving a process will there be considerable impact on memory consumption. We are able to get the process instance from the process tab even after archiving the process (auto archival of 7 days).
So will these process instance which are archived still occupy space in memory ? Do we have to delete those instances every time to improve memory usage ? Is there any other way to improve memory usage ?


2) Which of these will be considered as an active process : process completed using Terminate end event or process completed using just an end event ?
Is there any difference in memory consumption when we complete a process using a Terminate End event when compared to completing a process using an end event?

OriginalPostID-212774

OriginalPostID-212774

  Discussion posts and replies are publicly visible

  • @michaelg - Point 1 - Only completed or cancelled processes are archived. If a process instance is archived it is never loaded in memory again hence it improves memory usage. The best practice is to modularise your process model in small sub process and archive the processes as early as possible to free memory.
    2) Active processes are the process which has atleast one of the flow active or one of the node active. If you use terminate event in process and the flow reaches it, then process is terminated and completed regardless of active nodes available. So if a flow reaches normal end event and it is the only flow in the process then process completes, else it remains active.
  • No you do not have to delete a process which is archived. Once archived it does not take the system memory as such. In your case i think the process is still active that's why it is not still archived. Difference between end event and terminate event node is that terminate event node will complete the process once the flow reach to it even if there is not active node present in that process but on contrary end event will not complete the process if there is still an active node present in that process.
  • in case of terminate event it will complete the process once the flow reach to it even if there is any active node present in that process.: Correction
  • @michaelag Hi, here goes answers that are specific to your questions to the best of my knowledge and please feel free to get back to us in case of any follow-up questions:
    1) So will these process instance which are archived still occupy space in memory ?
    The archived instances won't occupy any space in the memory anymore but they occupy the disk space as we are able to search through the archived processes and unarchive them on need basis at a later point of time.

    Do we have to delete those instances every time to improve memory usage ?
    This depends on the situation as per my knowledge. If there is a need to unarchive the instance later for auditing purpose, don't make any configuration in such a way that process is deleted, as the deleted process instance wouldn't be available for unarchival. I believe that there isn't a great difference between deletion and archival, as in both cases, process isn't loaded into memory but deletion makes the instance unavailable permanently where as archiving provides us with a option to unarchive the instance later for audit trail.

    Is there any other way to improve memory usage ?
    I believe that the documentation at https://forum.appian.com/suite/help/16.2/Creating_Memory_Efficient_Models_Best_Practices.html should give a bird's-eye view how you could do this.

    2) Which of these will be considered as an active process : process completed using Terminate end event or process completed using just an end event ?
    From documentation: "A process can have multiple End Events. If so, the different branches of a process remain active until each active path reaches one of the multiple End Event nodes. In such cases, a Terminate Process event can be used to stop all branches of a process, even if one or more branches have not yet reached an End Event node." So if the process has reached the end event node(s) and when there aren't any other active nodes in the process, the process is said to be completed and it becomes ready for the archival as per the settings. And in case of Terminate event, all the active branches will be stopped and process is completed immediately and even here also, the process gets ready for archival. So the only difference as per my knowledge is, the Terminate event stops all the branches and completes the process whereas the process configured with the end event(s) is said to be completed when all the active branches in it comes to end and aren't active any more.

    Is there any difference in memory consumption when we complete a process using a Terminate End event when compared to completing a process using an end event?
    To the best of my knowledge, there isn't a difference as the archival of a process is completely dependent on status of the process. In case of Terminate, the process will be completed immediately(as the Terminate event stops all the active branches in the process) and the process gets ready for archival(as per the settings), whereas in case of End Event, the process is said to be completed when there aren't any more active branches in the process and after the completion, the process gets ready for archival(as per the settings).
  • 0
    A Score Level 1
    in reply to sparshs

    hi , how can u identify any active node in the process flow?

  • 0
    Certified Lead Developer

    1.) Archived processes that successfully archive no longer take up any RAM, what they take up is HD.  Luckily, absolutely enormous HDs are extremely cheap.  Archiving is very recommended for all your processes to aid in tracking down bugs.  If you feel the need you can select some processes that have very few errors and remain quite stable for deletion to free up some HD space.  With good server hardware it shouldn't be necessary to do that for quite a long time.

    1 b) Are there any other ways to improve memory usage?  Here are some:

    Keep your process variables small

    Your process history keeps the state of each PV at the beginning and end of every script task.  Therefore, if you do several operations on the same PV, try to do all operations in the same place, or as few places as you can.  That way only one or two versions of it get saved.

    Avoid deeply nested subprocesses.  Every sub-process runs on the same process execution engine as it's parent.  The whole stack is on the same box.  If you can use startProcess, that can be load-balanced onto another box.

    If you aren't going to use the output of a subprocess for anything, use startProcess or asynch, move on, and get the parent ready to archive.

    Make your queries such that they filter as much data out as possible.  Send the smallest amount of data you can back from your database to Appian.  You might be tempted to get all the records, store them in a PV, then use Appian to filter out the one you want to display.  Don't do this.  Your RDBMS is much better at filtering, will do it much faster, and you'll have less in your Appian's RAM.

    Do not save storedValues unless you are actually going to use it later in the process.  You can look in your database to see if it was stored correctly.

    You can use many subprocesses at the same level, especially for a long-running process.  That way, the bulk of the running process can already be on it's way to being archived before the whole thing is even done.

    Send as little data as possible to your subprocesses, and return as little data as possible back.  If you have a CDT with 35 data elements in it, and you want to send the whole thing to your subprocess even though you know you're only using 2 fields, don't do it.  Send only those 2 in separate variables.

    Do everything you can asynchronously.  Avoid all waiting it is possible to avoid.

    Avoid as much MNI as possible.  Node instances can be fairly big, and every one of them stays in memory until the process archives.  Use a!forEach as hard as you can.

    Make sure abandoned tasks eventually time out, and the process archives.

    Shorten the system-wide default for archival time down a few days if you have persistent memory problems.  Usually any problems you have to triage will result in errors that prevent the problem processes from archiving anyway.

    2.)If a process has active nodes (surrounded by green and still performing whatever operation), the process won't end when it reaches a regular End Node.  End Node behavior can sometimes be a little unexpected, so Appian best practice is that every process model feature at least one Terminate Node.  That stops any Active nodes in the middle of what they were doing and kills the whole process. 

    End Node without set to Terminate should be specifically for a process branch that has done all it needs to do, but other parts of the process should finish what they're doing too.  When you want the flow here to stop without stopping what's going on over there, making sure everything finishes up before you move on.  It should be used to eliminate race conditions.

  • Great deal of knowledge shared here!

    In addition please also take a look at the Engines section of the following KB which applies to on premise environments as well:

    https://community.appian.com/support/w/kb/1574/kb-2011-how-to-address-high-memory-usage-in-appian-cloud-environments#Process_Execution_and_Process_Analytics