Java heap space error by posting large file (200MB) through rest service
1
Hi Mendix people, I have a problem when using a rest call to post a file of 200MB to an other system. Locally, everything goes well. But on ACCP this causes an error. When uploading (and sending) a smaller file, everything goes well. When I tried it to send the large file with Postman, it also goes well. So I think that it is in Mendix that this isn't possible to send large files using a rest call. Is this an issue that you also know? And how can we solve this? The following message is from the log file: 10:19:47APPINFO# 10:19:47APPINFO# java.lang.OutOfMemoryError: Java heap space 10:19:47APPINFOThe application has been stopped successfully. 10:19:47APPINFO# -XX:OnOutOfMemoryError="kill -s USR2 13" 10:19:47APPINFO# Executing /bin/sh -c "kill -s USR2 13"... 10:19:47APPINFOWaiting for the application to shutdown... 10:19:47APPCRITICALActionManager: Error in execution of monitored action 'RegularClientAction' (execution id: 1643966382378-32, execution type: CLIENT) 10:19:47APPCRITICALActionManager: java.lang.OutOfMemoryError: Java heap space 10:19:47APPINFOat java.base/java.util.Arrays.copyOf(Unknown Source) 10:19:47APPINFOat java.base/java.io.ByteArrayOutputStream.grow(Unknown Source) 10:19:47APPINFOat java.base/java.io.ByteArrayOutputStream.ensureCapacity(Unknown Source) 10:19:47APPINFOat java.base/java.io.ByteArrayOutputStream.write(Unknown Source) 10:19:47APPINFOat javax.activation.DataHandler.writeTo(DataHandler.java:87) 10:19:47APPINFOat javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1670) 10:19:47APPINFOat javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:972) 10:19:47APPINFOat javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:537) 10:19:47APPINFOat com.mendix.http.FormData.$anonfun$content$1(FormData.scala:21) 10:19:47APPINFOat com.mendix.http.FormData$$Lambda$1828/0x0000000101065040.apply(Unknown Source) 10:19:47APPINFOat com.mendix.integration.util.AutoCloseableUtil$.using(AutoCloseableUtil.scala:10) 10:19:47APPINFOat com.mendix.http.FormData.content(FormData.scala:20) 10:19:47APPINFOat com.mendix.integration.http.HttpBody$.$anonfun$createFromFormData$2(HttpBody.scala:75) 10:19:47APPINFOat com.mendix.integration.http.HttpBody$$$Lambda$1338/0x0000000100bdd040.apply(Unknown Source) 10:19:47APPINFOat com.mendix.integration.actions.microflow.RestCallAction.executeRequest(RestCallAction.scala:71) 10:19:47APPINFOat com.mendix.integration.actions.microflow.RestCallAction.execute(RestCallAction.scala:60) 10:19:47APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.$anonfun$execute$1(MicroflowObject.scala:32) 10:19:47APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowObject$$Lambda$1371/0x0000000100c59840.apply(Unknown Source) 10:19:47APPINFOat scala.Option.flatMap(Option.scala:283) 10:19:47APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowObject.execute(MicroflowObject.scala:29) 10:19:47APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.$anonfun$executeAfterBreakingIfNecessary$2(MicroflowImpl.scala:172) 10:19:47APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl$$Lambda$1369/0x0000000100c58040.apply(Unknown Source) 10:19:47APPINFOat scala.Option.flatMap(Option.scala:283) 10:19:47APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAfterBreakingIfNecessary(MicroflowImpl.scala:172) 10:19:47APPINFOat com.mendix.modules.microflowengine.microflow.impl.MicroflowImpl.executeAction(MicroflowImpl.scala:119) 10:19:47APPINFOat com.mendix.systemwideinterfaces.core.UserAction.execute(UserAction.java:46) 10:19:47APPINFOat com.mendix.basis.actionmanagement.CoreActionHandlerImpl.doCall(CoreActionHandlerImpl.scala:71) 10:19:47APPINFOat com.mendix.basis.actionmanagement.CoreActionHandlerImpl.call(CoreActionHandlerImpl.scala:49) 10:19:47APPINFOat com.mendix.core.actionmanagement.CoreAction.call(CoreAction.java:54) 10:19:47APPINFOat com.mendix.basis.actionmanagement.ActionManagerBase$1.execute(ActionManagerBase.java:147)
asked
Lizanne Smokers-Both
1 answers
4
Hi Lizanne,
This depends on the size of your container. I have tried exact the same scenario on an XL container and this works without problems. Maybe you are able to test it on a bigger container. Otherwise you could try to split up the large file in chunks.