Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Heap Space (CMS with huge files)
    text
    copied!<p>EDIT:</p> <p>Got the directory to live. Now there's another issue in sight:</p> <p>The files in the storage are stored with their DB id as a prefix to their file names. Of course I don't want the users to see those.</p> <p>Is there a way to combine the response.redirect and the header setting für filename and size?</p> <p>best,</p> <pre><code> A </code></pre> <p>Hi again,</p> <p>new approach:</p> <p>Is it possible to create a IIS like virtual directory within tomcat in order to avoid streaming and only make use of header redirect? I played around with contexts but could'nt get it going...</p> <p>any ideas?</p> <pre><code> thx </code></pre> <p>A</p> <p>Hi %,</p> <p>I'm facing a wired issue with the java heap space which is close to bringing me to the ropes.</p> <p>The short version is:</p> <p>I've written a ContentManagementSystem which needs to handle huge files (>600mb) too. Tomcat heap settings:</p> <p>-Xmx700m -Xms400m</p> <p>The issue is, that uploading huge files works eventhough it's slow. Downloading files results in a java heap space exception.</p> <p>Trying to download a 370mb file makes tomcat jump to 500mb heap (which should be ok) and end in an Java heap space exception.</p> <p>I don't get it, why does upload work and download not? Here's my download code:</p> <pre><code>byte[] byt = new byte[1024*1024*2]; response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\""); FileInputStream fis = null; OutputStream os = null; fis = new FileInputStream(new File(filePath)); os = response.getOutputStream(); BufferedInputStream buffRead = new BufferedInputStream(fis); while((read = buffRead.read(byt))&gt;0) { os.write(byt,0,read); os.flush(); } buffRead.close(); os.close(); </code></pre> <p>If I'm getting it right the buffered reader should take care of any memory issue, right?</p> <p>Any help would be highly appreciated since I ran out of ideas</p> <p>Best regards,</p> <p>W</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload