Memory Usage By Unused Process Variables?

Certified Lead Developer

Hi All,

Do process variables occupy memory in Appian even if they do not hold any data in a process instance?? Anything like memory allocation at run time based on their type of declaration like text, array etc.

 

If yes, how can this be verified? any logs etc.?

 

Thanks.

Hitesh

  Discussion posts and replies are publicly visible

Parents
  • Hi Hitesh, Please follow the below article under Appian Playbook where it was mentioned in the second paragraph.
    community.appian.com/.../creating-memory-efficient-models
  • 0
    Certified Lead Developer
    in reply to Poorna Guduri
    Hi Poorna,

    The paragraph talks about the data being held in the process variables but if it is unused or not holding any data at run time, will it still occupy memory?Any more pointers?

    Thanks.
    Hitesh
  • 0
    A Score Level 1
    in reply to hiteshd
    The sentence - "The greater the number of process variables and the larger the amount of data stored in process variables, the more memory a process instance will consume." - says about the entire list of process variables that we keep in an instance (irrespective of using or not using them), as per my understanding. So, the unused variables also might occupy space in memory which need to be rectified from performance perspective.
    To your second question, I am not sure whether we can find the same in some log or so.
  • 0
    Certified Lead Developer
    in reply to hiteshd
    Yes it will occupy some memory, if you have created a variable then it's obvious that it will occupy some memory for it. For best example, as Appian built on the top of Java, when we define a variable at a class level and assign no value to it, but still JVM assigns some by default values to these variables based on their type, which holds some memory, and also in case of local variables, it holds null as a value. Similarly in Process Variable, if there is no data available for PV that means currently it is holding the null as it's value, null cannot be equals to empty.

    For best example to justify the difference between null and empty, when we insert null as a value through SQL into DB table, then the DB table displays the column value as null but in case of empty it just shows blank.

    Talking in terms of Appian, you can try checking the type of null using

    typename(typeof(null)) which will return Text

    also find out it's length, using len() function as
    len(typename(typeof(null))) which will return 4

    So, we can say that, when we define a PV which do not holds any data will still hold some default values either as null or their respective type like 0 for Integer and will still occupy some space for it.

    This is the reason, best programming approach says, do not create unused variables.
Reply
  • 0
    Certified Lead Developer
    in reply to hiteshd
    Yes it will occupy some memory, if you have created a variable then it's obvious that it will occupy some memory for it. For best example, as Appian built on the top of Java, when we define a variable at a class level and assign no value to it, but still JVM assigns some by default values to these variables based on their type, which holds some memory, and also in case of local variables, it holds null as a value. Similarly in Process Variable, if there is no data available for PV that means currently it is holding the null as it's value, null cannot be equals to empty.

    For best example to justify the difference between null and empty, when we insert null as a value through SQL into DB table, then the DB table displays the column value as null but in case of empty it just shows blank.

    Talking in terms of Appian, you can try checking the type of null using

    typename(typeof(null)) which will return Text

    also find out it's length, using len() function as
    len(typename(typeof(null))) which will return 4

    So, we can say that, when we define a PV which do not holds any data will still hold some default values either as null or their respective type like 0 for Integer and will still occupy some space for it.

    This is the reason, best programming approach says, do not create unused variables.
Children