How are you creating the XML variable? Becuase if you are building it up manually by concatenating strings together this is common. This is because every time you concatenate a string it creates a new Java String instance, which means you have (depending on how many columns you have) hundreds of thousands or even millions of String instances that won't be garbage collected until after the request is over and all references to them are gone.
Use a Java StringBuffer (or if you're on Java 5 or 6, a StringBuilder) to build up the XML string, as these are specifically for building up large strings without constantly creating new instances. You can find easy CFC wrappers for these and other Java classes at http://www.informationsavvy.com/coldfusion/. On Tue, Apr 15, 2008 at 10:51 AM, Joel Watson <[EMAIL PROTECTED]> wrote: > In my application, I am attempting to > > 1.) Query table (50,000 + records) > 2.) Create XML variable from query > 3.) Zip file and push to user > > Unfortunately, when I do this, I get the following error: > > 500 > > ROOT CAUSE: > java.lang.OutOfMemoryError: Java heap space > > javax.servlet.ServletException: ROOT CAUSE: > java.lang.OutOfMemoryError: Java heap space > at > coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:70) > at > coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) > at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) > at jrun.servlet.FilterChain.service(FilterChain.java:101) > at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) > at > jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) > at > jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284) > at > jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) > at > jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) > at > jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) > at > jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) > at > jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) > at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66) > > > As far as I can tell, the problem occurs when I try to specify the xml > variable as the the cfzipparam, as so: > > <cfzipparam content="#toString(xRawFacilityReports)#" > entrypath="facilityreports.xml"> > > Obviously, the amount of data I am attempting to write is large, so is > this a matter of reaching a limit on cfzipparam, or am I approaching this > the wrong way? > > Thanks in advance for any help that you can provide. > > Joel Watson > http://singularityconcepts.com > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:303423 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

