Hibernate - Entities with Associated Property Causing Heap Space Error

Hello everyone,

I have some entities that have a property defining a relationship with another entity (Many-To-Many or One-To-Many and etc,). For whatever reason, these associated properties are causing Heap Space error message. If I comment out these associated properties, I can access the entity without any issue.

Here is an example.

property name="associatedUsers"
			 singularname="associatedUser"
			 fieldtype="many-to-many"
			 linktable="User_App_Associations"
			 fkcolumn="appId"
			 inversejoincolumn="userId"
			 cfc="server.model.User"
			 remotingfetch="false"
			 lazy="true"
			 fetch="join";

Since lazy is true, I can initially load the entity without any issue, but if I call getter for this property or try to writedump the entity, then Lucee hangs up after throwing the Heap Space error.

I’m working on gaining access to Tomcat Service Control to try increasing the size of heap. Does anyone know what could be causing this or have set up entity relationship successfully?

Thank you.

I was able to access Lucee-Tomcat Service Control and increased the initial memory pool and maximum memory pool. The heap memory still spikes up when I try to writedump the data of an entity that has relationship with another entity.

After increasing the heap size, I no longer get the heap space error, but the application still hangs up and I need to restart Lucee. I’d appreciate any input.

UPDATE: I eventually figured out that it may be that lazy loading isn’t working on Lucee. The reason why I got heap space error and Lucee crashing is because it’s trying to return all joined data and they are converted to json. Since some join tables have thousands of records, the data may be big enough to crash if I were to writedump.

Now, I gotta figure out why lazy loading isn’t working here…