AnsweredAssumed Answered

Out of memory issues when doing lots of variable get/set

Question asked by krdevos on Aug 28, 2012
Latest reply on Aug 29, 2012 by trademak
Hi,

I'm using activiti in a prodcution environment to handle a simple sort of approval flow. I put a serializable object to the processinstance to pass through the different steps. There is also a possibility to update the variable without changing task.

However when I try to do a lot of get variables and set again I get an out of memory exception, probably a stream that's not closed each time.

We merely use taskservice and runtimeservice.getVariables, but calling this a few time in a row, with a serializable object of a few MB will result in an out of memory issue.

Anyone has an idea to solve this?

thx

at org.activiti.engine.impl.variable.SerializableType.getValue(SerializableType.java:49)
   at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.getValue(VariableInstanceEntity.java:158)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:84)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.collectVariables(VariableScopeImpl.java:81)
   at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.getVariables(VariableScopeImpl.java:65)
   at org.activiti.engine.impl.cmd.GetTaskVariablesCmd.execute(GetTaskVariablesCmd.java:62)
   at org.activiti.engine.impl.cmd.GetTaskVariablesCmd.execute(GetTaskVariablesCmd.java:31)
   at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.TaskServiceImpl.getVariables(TaskServiceImpl.java:172)

Outcomes