0 Replies Latest reply on Apr 6, 2009 10:10 AM by rmorgan

    java.lang.OutOfMemoryError: Java heap space

    rmorgan Level 1



      I think I messed up in my design. I have an app where users can upload images for a contest we are having. Everything works fine except when viewing the uploads. I have a feature so that the "admin" of the contest can do a one click display/print for all the uploads, and this is where the problem occurs. When this option is selected, the page sits and churns forever, and eventually will kick back the error in the subject line. When I googled this, it said to increase the heap size. It was defaulted to 512MB and I changed it to 1024MB and it still does not make a difference. Before I go and keep increasing the heap size, I want to make sure that is the path I should take.   My code is below.


      One caveat: There could be one kicker in the whole process. Despite my recommendations, of allowing only jpg, bmp, gif or tif the users that know more than me also wanted to allow pdf and eps files. Using my code below I fully understand there could be some problems with displaying. Any suggestions to improve this would be appreciated.



      <cfquery name="getall" datasource="#dsn#">
      Select imagepath
      from tradition
      <!--- where auto_id = '#url.cfgridkey#' --->


      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
      <title>Untitled Document</title>


      <body >
      <cfdocument format="pdf" pagetype="letter">
      <cfoutput query="getall">#getall.imagepath#<br /><br /><br />
      <img src="../uploads/#getall.imagepath#">
      <cfdocumentitem type="pagebreak"></cfdocumentitem>