Intermediate values used in function not released until function is finished


I have been running into memory issues trying to solve this year's Advent of Code programming puzzles in CFML.

It seems to me as if Lucee holds on to all intermediate values used in a function until the function is finished.

Steps to reproduce


Actual result

Using the latest lucee/lucee52 docker image ( with "LUCEE_JAVA_OPTS=-Xms256m -Xmx512m -Xloggc:/opt/lucee/web/logs/GC.log -XX:+PrintGCDetails -XX:+PrintGCDateStamps":


And then nothing more. I see in GC.log that the JVM performs 1-2 full GCs every second and that it manages to free very little memory.

I have also tested to upgrade to inside the container but that made no difference.

On Adobe ColdFusion 2016.0.0.298074 the script completes without issues and the time between every percentage of completion is fairly constant all the time.

Expected result

The request should complete without issues. At any point in time the function is referencing very little data so the JVM should be able to GC the intermediate values.


Split up the work:





Jonas Meller
January 17, 2018, 5:29 PM

Hi and ,

Thank you for looking into this issue.

Your interpretation of what I meant is correct. That was my (incorrect) guess of what was happening based on the behavior I was seeing.

I can confirm that your suggestion helps both with the test case and with my Advent of Code-solutions.

Pothys - MitrahSoft
February 2, 2018, 7:22 AM

Hi ,

I hope above workaround is helps you. Can I close this ticket?

Jonas Meller
February 10, 2018, 1:58 PM

Sure, that's fine by me. Thanks!

Zac Spitzer
February 22, 2018, 3:25 AM

this commit broke my app, output inside a function with output="true" with a cfabort was returning nothing

the task status is rejected, but the following change wasn't reverted?

private boolean bufferOutput=false; wasn't reverted back to private boolean bufferOutput=true;

i just wasted a couple of hours tracking this down, enabling "Settings/Output/Buffer Tag Body Output" got things working again

Pothys - MitrahSoft
February 22, 2018, 6:20 AM

Hi ,

I run a quick test with following code,

It output returns as "Susi" as expected, even though I've unchecked the "Settings/Output/Buffer Tag Body Output" in admin.

I've tested with Lucee snapshot.

I missed anything here? Or Can you please post the code here?



Michael Offner


Jonas Meller





Fix versions

Affects versions