Image Upload causes OOM Crash

Hi, I have a small application where I try to build a photo log of some plants. I call the app via http-requests (no native or hybrid) on my mobile phone. I have an image uploader on a page with maximum file size set to 5MB. Everything works fine on my local server. But as soon as I use the (free) space on I am not able to upload an image. The server always crashes, when I use the camera on my phone to take and upload a picture. This is the header of the crash stack trace: Uploading bits for app with guid 2e8d7291-3959-434f-bb03-d15cda693172 13:14:39APPWARNINGConnector: Only content type 'application/json' is allowed (found 'null'). 13:15:10APPINFO# 13:15:10APPINFO# java.lang.OutOfMemoryError: Java heap space 13:15:10APPINFO# -XX:OnOutOfMemoryError="kill -s USR2 6" 13:15:10APPINFO# Executing /bin/sh -c "kill -s USR2 6"... 13:15:10APPINFOWaiting for the application to shutdown... 13:15:10APPCRITICALM2EE: An unhandled error occurred in the MxRuntime. 13:15:10APPCRITICALM2EE: java.lang.OutOfMemoryError: Java heap space 13:15:10APPINFOat java.desktop/java.awt.image.DataBufferByte.<init>(Unknown Source) 13:15:10APPINFOat java.desktop/java.awt.image.Raster.createInterleavedRaster(Unknown Source) 13:15:10APPINFOat java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source) 13:15:10APPINFOat java.desktop/com.sun.imageio.plugins.jpeg.JPEGImageReader.readRaster(Unknown Source) 13:15:10APPINFOat com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.readImageAsRasterAndReplaceColorProfile( 13:15:10APPINFOat I know space is limited, but is there a chance to compress the image information before uploading it? Or any other workaround? Regards Max
1 answers

what is the size of the uploaded image? 

I do expect that this is more then 5MB and causes the OOM