Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Service Desk incoming mail run into Java heap space (java.lang.OutOfMemoryError)

We try starting with 8.3.0 JIRA Software and Jira Service Desk (both updated today), but incoming emails for Service Desk run into a java heap space error (see error log below).

Jira-Service java memory is set to 4096M

Incoming mail is configured per Service-Desk.

There are about 50 issues in jira (we just started testing) and 37 mails in the inbox. It seems that emails without attachment are loaded. Mails with 1.2 MB attachment (for example) run into Java heap space error.

atlassian-jira-incoming-mail.log:

2019-07-23 10:56:05,850 ERROR [] Caesium-1-3 ServiceRunner MailJobRunner Failed
java.lang.OutOfMemoryError: Java heap space
at org.apache.commons.io.output.ByteArrayOutputStream.needNewBuffer(ByteArrayOutputStream.java:128) [commons-io-2.6.jar:2.6]
at org.apache.commons.io.output.ByteArrayOutputStream.write(ByteArrayOutputStream.java:159) [commons-io-2.6.jar:2.6]
at com.sun.mail.imap.IMAPMessage.writeTo(IMAPMessage.java:917) [jira-email-processor-plugin-4.2.0.jar:?]
at com.atlassian.jira.internal.mail.processor.util.MimeMessageBase64ChunkStream.fullyLoadMessageToMemory(MimeMessageBase64ChunkStream.java:32) [jira-email-processor-plugin-4.2.0.jar:?]
at com.atlassian.jira.internal.mail.processor.util.MimeMessageBase64ChunkStream.<init>(MimeMessageBase64ChunkStream.java:22) [jira-email-processor-plugin-4.2.0.jar:?]
at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore.createMailItemChunks(MailItemStore.java:247) [jira-email-processor-plugin-4.2.0.jar:?]
at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore.lambda$null$4(MailItemStore.java:222) [jira-email-processor-plugin-4.2.0.jar:?]
at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore$$Lambda$3152/548166455.apply(Unknown Source) [?:?]
at io.atlassian.fugue.Option.map(Option.java:259) [fugue-4.7.2.jar:?]
at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore.lambda$createMailItem$5(MailItemStore.java:220) [jira-email-processor-plugin-4.2.0.jar:?]
at com.atlassian.jira.internal.mail.processor.feature.puller.mailitem.MailItemStore$$Lambda$3151/1454284798.apply(Unknown Source) [?:?]
at com.atlassian.pocketknife.internal.querydsl.DatabaseAccessorImpl.lambda$execute$0(DatabaseAccessorImpl.java:69) [jira-email-processor-plugin-4.2.0.jar:?]
at com.atlassian.pocketknife.internal.querydsl.DatabaseAccessorImpl$$Lambda$1570/1637902549.execute(Unknown Source) [?:?]
at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.executeInternal(DefaultTransactionalExecutor.java:87) [?:?]
at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.lambda$execute$0(DefaultTransactionalExecutor.java:43) [?:?]
at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor$$Lambda$1232/1655291157.execute(Unknown Source) [?:?]
at com.atlassian.sal.jira.rdbms.JiraHostConnectionAccessor$$Lambda$1234/1942828205.apply(Unknown Source) [?:?]
at com.atlassian.jira.database.DatabaseAccessorImpl.runInManagedTransaction(DatabaseAccessorImpl.java:131) [classes/:?]
at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) [?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_202]
at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26) [atlassian-plugins-core-5.2.2.jar:?]
at com.sun.proxy.$Proxy161.runInManagedTransaction(Unknown Source) [?:?]
at sun.reflect.GeneratedMethodAccessor245.invoke(Unknown Source) [?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_202]
at java.lang.reflect.Method.invoke(Method.java:498) [?:1.8.0_202]
at com.atlassian.plugin.osgi.bridge.external.HostComponentFactoryBean$DynamicServiceInvocationHandler.invoke(HostComponentFactoryBean.java:131) [atlassian-plugins-osgi-bridge-5.2.2.jar:?]
at com.sun.proxy.$Proxy161.runInManagedTransaction(Unknown Source) [?:?]
at com.atlassian.sal.jira.rdbms.JiraHostConnectionAccessor.runInStartedOrExistingTransaction(JiraHostConnectionAccessor.java:130) [?:?]
at com.atlassian.sal.jira.rdbms.JiraHostConnectionAccessor.execute(JiraHostConnectionAccessor.java:60) [?:?]
at com.atlassian.sal.core.rdbms.DefaultTransactionalExecutor.execute(DefaultTransactionalExecutor.java:40) [?:?]
at com.atlassian.pocketknife.internal.querydsl.DatabaseAccessorImpl.execute(DatabaseAccessorImpl.java:67) [jira-email-processor-plugin-4.2.0.jar:?]

 

Do you have any idea what we can do or is it a service desk/Jira bug (I suppose)?

Best regards

Steffen

1 answer

0 votes
Petr Vaníček Community Leader Jul 23, 2019

Hi,

can you share screenshot of  part System info (/secure/admin/ViewSystemInfo.jspa)

Look at my example what I need to see - if you are using your certificate then just delete part of image where is cert password.
image.png

Hi Petr,

here is the screenshot:

Screenshot_Jira.png

The JVM-Parameters are (if you like text searching):

-Djava.awt.headless=true -Datlassian.standalone=JIRA -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dmail.debug=true -Dorg.dom4j.factory=com.atlassian.core.xml.InterningDocumentFactory -XX:-OmitStackTraceInFastThrow -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintGCCause -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=20M -Xloggc:C:\Program Files\Atlassian\JIRA\logs\atlassian-jira-gc-%t.log -XX:InitialCodeCacheSize=32m -XX:ReservedCodeCacheSize=512m -Dcatalina.home=C:\Program Files\Atlassian\JIRA -Dcatalina.base=C:\Program Files\Atlassian\JIRA -Dignore.endorsed.dirs=C:\Program Files\Atlassian\JIRA\endorsed -Djava.io.tmpdir=C:\Program Files\Atlassian\JIRA\temp -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.util.logging.config.file=C:\Program Files\Atlassian\JIRA\conf\logging.properties exit abort -Xms384m -Xmx4096m

 

The memory sometimes go up over 3000 MB (probably because of the incoming mail failure). As mentioned above it is only a very very small Jira installation with 7 projects and 50 issues.

Petr Vaníček Community Leader Jul 24, 2019

Try to set Xms to 2048m

Because as minimal value it's small for Jira 8. If you made upgrade from Jira 7 then I think it will be reason. Try it and let me know.

If have set it to 2048, but it does not help.

The installation is not upgradet from Jira 7. It was a new 8.2.2 installation, which was upgraded to 8.3. The error also occured in 8.2.2 before.

Screenshot_Jira2.png

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Asked in Jira Service Desk

Calling all Insight users, we need your help!

Hello Insight users,  As part of our (Mindville's) acquisition by Atlassian, our training team is looking to build some new Insight training materials. It would really helpful if you can ...

52 views 0 0
View question

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you