title: java.lang.OutOfMemory error when fetching records from Database
body: <p>When I try to fetch around 20,000 records and return to ArrayList then it throws java heap space error.</p>
  
  <pre><code>   JdbcTemplate select = new JdbcTemplate(dataSource);
              String SQL_SELECT_XML_IRP_ADDRESS = " SELECT * FROM "+ SCHEMA +".XML_ADDRESS "+
                                                      " WHERE FILE_NAME = ? ";
              Object[] parameters=new Object[] {xmlFileName};
              return (ArrayList&lt;XmlAddressDto&gt; ) select.query(SQL_SELECT_XML_ADDRESS,
                      parameters,new XmAddressMapExt());
  </code></pre>
  
  <p>Our database is Oracle and  using oracle thin driver.<br>
  Is there any solution for this ? How should i process this effectively ?</p>