Heap space error while deserializing database session data

Hi all,
I saw the mention “email to the list before creating a jira ticket” only when I had the whole ticket written, so I did already submit the ticket: [LDEV-3701] - Lucee
But here it goes…

I received some odd Out Of Memory Errors coming from my servers. I noticed some requests triggered a sudden drop of the available JVM memory to zero, leading to the OOME. After much investigation, I found out it had to do with the deserialization of session data stored in the database.

If you use a JVM with 2GB or less, and run these steps, you will get an OOME:

<!--- JavaConverter is used in Lucee to deserialize database session data --->
<cfset my_IKStorageValue = createObject('java', 'lucee.runtime.converter.JavaConverter').deserialize(			'== see issue; very large base64 value =='	) />
<cfdump var="#my_IKStorageValue.getValue()#" />

The memory issue happens at IKStorageValue.getValue() by the way, not at the deserialize().

The session data itself is around 10 keys, containing strings and 2 structs with more data. One of those structs is the form scope, and when looking at the output of the cfdump above (using -Xmx4096m), I can see that form scope is seen as “Struct (soft)”.
That might be the problematic part?

Regards, Paul Klinkenberg

Don’t forget to tell us about your stack!
OS: Ubuntu 20.x / OSX latest
Java Version: OSX+ 16.0.1 (Oracle Corporation) 64bit / Ubuntu + openjdk 11.0.11 2021-04-20
Tomcat Version: 8 and 9
Lucee Version: 5.3.7.48

1 Like

Hi Paul,

the “email to the list before creating a jira ticket” is more focussed at newer users with an unresolved issue, you’ve been around a while, know what your doing and most importantly, it’s a great, actionable bug report.

We’re just trying to avoid triaging open ended bugs in jira

z