After uploading files we get an OutOfMemoryError: Java heap space
We use a the p:fileUpload widget form primefaces with an upload listener like this:
<pre><code><p:fileUpload fileUploadListener="#{logic.uploadFile}</pre></code>
In the listener method we copy the file content to an byte array on a data class to store it later. The script looks like this:
byte[] content = IOUtils.toByteArray(in.fileUploadEvent.getFile().getInputstream());
But after uploading multiple files we get an OutOfMemoryError: Java heap space