We are trying to upload large files(more than 6gb) through jQuery fileupload and in grails we accessing the file as MultipartFile. When trying to write the same into byte array, getting "out of memory"("Caused by OutOfMemoryError: Java heap space") exception.Code snippet.
def finalName =new File("${path}/${newFile}")
byte[] bytes = file.getBytes();
BufferedOutputStream stream = new BufferedOutputStream(new FileOutputStream(finalName ,true));
stream.write(bytes);
stream.close();
can anyone help me to resolve this issue without adding static heap size value in buildConfig.groovy file.
Thank you.