title: Java out of memory using fileoutstream
body: <p>I,m trying to export some files from a system and save it in my drive, the problem is that some files are pretty big and I get the java out of memory error. </p>
  
  <pre><code>FileOutputStream fileoutstream = new FileOutputStream(filenameExtension);
  fileoutstream.write(dataManagement.getContent(0).getData());
  fileoutstream.flush();
  fileoutstream.close();
  </code></pre>
  
  <p>Any recomendation that I can try, I add the flush but now diference, this will call the export method,  generate the file and saved. I,m using a cursos to run over the data that I,m exporting not an array, I try to add more memory but the files are too big.</p>