title: Processing large xlsx file
body: <p>I need to auto-fit all rows in large (30k+ rows) xlsx file.</p>
  
  <p>The following code via apache poi works on small files, but goes out with <code>OutOfMemoryError</code> on large ones:</p>
  
  <pre><code>Workbook workbook = WorkbookFactory.create(inputStream);
  Sheet sheet = workbook.getSheetAt(0);
  
  for (Row row : sheet) {
      row.setHeight((short) -1);
  }
  
  workbook.write(outputStream);
  </code></pre>
  
  <p><strong>Update:</strong> Unfortunately, increasing heap size is not an option - <code>OutOfMemoryError</code> appears at <code>-Xmx1024m</code> and 30k rows is not an upper limit.</p>