cancel
Showing results for 
Search instead for 
Did you mean: 

OOM at end of process

wheli
Champ in-the-making
Champ in-the-making
Hello,

I have a process that I am running and at the very end, it generates an outOfMemory error. The stack trace doesn't have any of my own classes in it. It appears that it has something to do with the event logger, but I am not sure what my options are.


Nov 21, 2014 8:46:37 PM com.vaadin.Application terminalError
SEVERE: Terminal error:
com.vaadin.event.ListenerMethod$MethodException: Invocation of method buttonClick in org.activiti.explorer.ui.process.listener.StartProcessInstanceClickListener failed.
        at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:530)
        at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
        at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1219)
        at com.vaadin.ui.Button.fireClick(Button.java:567)
        at com.vaadin.ui.Button.changeVariables(Button.java:223)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.changeVariables(AbstractCommunicationManager.java:1460)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariableBurst(AbstractCommunicationManager.java:1404)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.handleVariables(AbstractCommunicationManager.java:1329)
        at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleUidlRequest(AbstractCommunicationManager.java:761)
        at com.vaadin.terminal.gwt.server.CommunicationManager.handleUidlRequest(CommunicationManager.java:325)
        at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:501)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.activiti.explorer.filter.ExplorerFilter.doFilter(ExplorerFilter.java:44)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Arrays.java:2694)
        at java.lang.String.<init>(String.java:203)
        at java.lang.StringBuilder.toString(StringBuilder.java:405)
        at com.fasterxml.jackson.core.util.TextBuffer.contentsAsString(TextBuffer.java:360)
        at com.fasterxml.jackson.core.io.SegmentedStringWriter.getAndClear(SegmentedStringWriter.java:98)
        at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2216)
        at org.activiti.engine.impl.event.logger.handler.VariableEventHandler.createData(VariableEventHandler.java:133)
        at org.activiti.engine.impl.event.logger.handler.VariableCreatedEventHandler.generateEventLogEntry(VariableCreatedEventHandler.java:17)
        at org.activiti.engine.impl.event.logger.DatabaseEventFlusher.closing(DatabaseEventFlusher.java:21)
        at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:129)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:47)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:45)
        at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)
        at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)
        at org.activiti.engine.impl.RuntimeServiceImpl.startProcessInstanceById(RuntimeServiceImpl.java:99)


Currently we have the following java opts set for memory:
"-Xmx1g -Xms1g -XX:MaxPermSize=128M"

Any help would be greatly appreciated.

Thanks!
7 REPLIES 7

trademak
Star Contributor
Star Contributor
Hi,

I would need more information about the process instance you are running.
Do you have a lot of variables, or any other specifics that could cause this?

Best regards,

wheli
Champ in-the-making
Champ in-the-making
We do have a lot of variables, but at the end of the last step, I've tried removing them:

<code>
@Override
    public void execute(DelegateExecution delegateExecution) throws Exception {
        ……
        delegateExecution.removeVariables();
        delegateExecution.removeVariablesLocal();      
    }
</code>

This doesn't really seem to make any difference though.

trademak
Star Contributor
Star Contributor
Do you have a specific variable which is very large?

Best regards,

wheli
Champ in-the-making
Champ in-the-making
I did, I was actually getting similar "out of memory" exceptions when doing things like this:

Map<String, Object> vars = delegateExecution.getVariables();
Map<String, Object> localVars = delegateExecution.getVariablesLocal();
logger.log(Level.FINEST, "Variables: {0}, Local Variables: {1}", new Object[]{vars, localVars});

The OOM would generate on the third line of that code.  I removed the logging and the problem seemed to resolve itself.  Even if I am working with large variables, should doing the .removeVariables and .removeVariablesLocal remove those?

It would appear to me that this is related to logging. Is there something I can do to disable that to get past this issue?

jbarrez
Star Contributor
Star Contributor
Where is this line of code? In the Explorer code? Or is this something in your own code?

wheli
Champ in-the-making
Champ in-the-making
The stack trace would imply that the issue lies within the activiti code:
org.activiti.engine.impl.event.logger.handler.VariableEventHandler.createData(VariableEventHandler.java:133)

The code I was referencing above:

Map vars = delegateExecution.getVariables();
Map localVars = delegateExecution.getVariablesLocal();
logger.log(Level.FINEST, "Variables: {0}, Local Variables: {1}", new Object[]{vars, localVars});

Is part of my own code, that has been removed.

It would appear as though the database logging is enabled, even though we are not setting that anywhere, as far as I can tell. (http://www.activiti.org/userguide/ - Event logging (Experimental))

wheli
Champ in-the-making
Champ in-the-making
It turns out we did have the database logging enabled in a different file that I was unaware of. I disabled this and things are working again. Thanks
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.