Intermediate values used in function not released until function is finished

Description

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

bug.cfm

Actual result

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

bug.log

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 5.2.6.29-SNAPSHOT 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.

Workaround

Split up the work:

workaround.cfm

Environment

None

Activity

Show:
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

https://github.com/lucee/Lucee/blob/5.2/core/src/main/java/lucee/runtime/config/ConfigImpl.java#L3360

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

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 5.2.6.51 snapshot.

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

Fixed

Assignee

Michael Offner

Reporter

Jonas Meller

Priority

Critical

Labels

None

Fix versions

Affects versions