This content has been marked as final. Show 3 replies
DropletEventServlet keeps a map of form element names to the corresponding FormHandler Nucleus path and property name (partially as a security measure, to prevent a form submit from exposing unsafe, non-formhandler-ish properties). If one uses IDs in the form element names (and, by default, form element names are named from from FormHandler path and property name), this creates a memory leak over time as entries in DropletEventServlet build up with unique IDs that are unlikely to be ever used again.1 person found this helpful
One can avoid using IDs in form element names when dealing with multiple elements by instead using something like array of maps (be sure to implement the correct array Bean property accessor methods that will auto-allocate an array as needed). For example, one might use properties "MyFormHandler.itemMapArray.id" and "MyFormHandler.itemMapArray.quantity". One could also use parallel arrays: "MyFormHandler.itemIds" and "MyFormHandler.quantities".
Thanks for the reply.
I have the following doubts:
1)The form handlers used in this particlular code are having session scope. So shouldn't these references be cleared when the session expires?
2) How can this be handled in case components like the /atg/commerce/order/purchase/CartModifierFormHandler.items.catalogRefId which is provided by ATG itself?
Edited by: 986774 on Feb 12, 2013 3:47 AM
After you get the memory leak warning, look at DropletEventServlet in /dyn/admin's component browser, and you can see the buildup of form element mappings for the page in question. DropletEventServlet is a globally scoped component (regardless of the scope of the form handlers it tracks), and does not remove entries over time (which is why it's important not to use IDs in FormHandler form element maps, and why it issues a warning once you at 500 for a form).
My guess is that the bug you are seeing is a fixed CSC bug that's been fixed in newer versions of ATG (2007.1 and later). You might want to check a newer versions of ATG to see if the form is still coded in the same way.