Marta,

Marta Gascó Julio wrote:
I'm afraid I cannot provide the template due to access restrictions
outside the company.

That's fine. The example you provided should be good enough.

Moreover I'm not sure on what template is causing
the OOME because I have several in the same conditions (thousands of
lines with dozens of macros).

Are you sure that Velocity is even to blame for the OOME? Are you sure it's not some database thing or other problem in your application?

#macro (GenGroup $prefix $This $NObj $Utilities $Existents $Elements $Generic 
$Layouts)
#set($lControl = "${NObj.GetName('Source', 'Header', '')}")
#set ($Level = 0)
#foreach($Elem in ${Elements})
#*      *##if (!${Elem.IsOk})
#*              *##set($lName = "${This.GetElementName(${Elem.Id})}${prefix}")
#*              *##set($Generic = "${Generic}#GenHeaderGroup(${prefix} 
${lName})")
#*              *##set($Layouts = "${Layouts}#GenLayoutGroup(${prefix} 
${lName})")
                        this.${lName} = new Object.${lControl}();
#*              *##RecursiveGenNews ($prefix $Elem $This $NObj $Utilities 
$Existents $Generic $Layouts $Level)
#*      *##else
#*              *##GenNewsForGroup(${Elem} ${prefix} ${NObj} ${Utilities} 
${Existents} ${lControl})
#*      *##end
#end
#end

Do any of these templates call the 'GenGroup' template:

- GenHeaderGroup
- GenLayoutGroup
- RecursiveGenNews
- GenNewsForGroup

??

I'm guessing that RecursizeGenNews calls itself. Are you sure it stops at an appropriate time? Infinite recursion almost always yields either a StackOverflowException or an OOME.

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to