title: JasperReports - Handle big data from database to PDF
body: <p>I have a report that takes a select that return me about 900k records (it´s about 100MB of data) and I need to create a <em>PDF</em> with it.</p>
  
  <p>So, my implementation is simple: I get the data from my JDBC Query, put into a <code>ArrayList</code> and pass it to my report. I had some problems with memory but I fixed it, my problem now is with CPU processing (it is always at 100%) that makes my process crash.</p>
  
  <p>My code is really simple:   </p>
  
  <pre><code> public OutputStream getOutputStream(OutputStream out) {
          try {
              JasperPrint print = JasperFillManager.fillReport(jasperName, params, fillList);
              JRExporter exporter = format.getExporter();
              exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
              exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, out);
              exporter.exportReport();
  
          } catch (Exception e) {
              throw new RuntimeException("Error getting the stream", e);
          }
          return out;
      }
  </code></pre>
  
  <p>I would like to know:</p>
  
  <ul>
  <li>How in this case could I use my CPU´s multiple cores?</li>
  <li>Is there another strategy to do that?</li>
  </ul>