SavyX
11/12/2025, 1:15 PMjdaugherty
11/12/2025, 8:20 PMSavyX
11/12/2025, 9:00 PMSavyX
11/14/2025, 2:50 PMBeanPropertyAccessorImpl
https://github.com/apache/grails-core/blob/939b61ad892c98d1ee5fc88f9e92f16bc38eea79/grails-fields/src/main/groovy/grails/plugin/formfields/BeanPropertyAccessorImpl.groovy
uses both @Canonical and @Memoized.
• FormFieldsTemplateService
https://github.com/apache/grails-core/blob/939b61ad892c98d1ee5fc88f9e92f16bc38eea79/grails-fields/src/main/groovy/grails/plugin/formfields/FormFieldsTemplateService.groovy
also contains multiple @Memoized methods.
What I’m observing is that every time a page is rendered, new entries are added to the org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache, and nothing ever evicts or caps this cache. Because each request creates a new command object instance, the Form Fields plugin generates new memoization keys on every request. It causes unbounded cache growth.
It seems no component is cleaning up or limiting these memoized caches, which eventually leads to memory leaks.
Does this analysis make sense?
Am I missing something in how the plugin should be used, or is this a bug in the plugin itself?
Before migrating to Spring Boot, we were running on Tomcat, and it seems Tomcat may have been cleaning up or isolating the caches in a way that prevented this buildup.SavyX
11/14/2025, 2:54 PMSteve Osguthorpe
11/14/2025, 4:39 PMgrails.plugin.fields.disableLookupCache
As mentioned here: https://github.com/apache/grails-core/blob/939b61ad892c98d1ee5fc88f9e92f16bc38eea7[…]roovy/grails/plugin/formfields/FormFieldsTemplateService.groovy
And see if that helps.SavyX
11/17/2025, 10:56 AMSteve Osguthorpe
11/17/2025, 11:00 AMSteve Osguthorpe
11/17/2025, 11:02 AMSavyX
11/17/2025, 11:05 AM