WmXSLT cache size issue


What is the process behing WmXSLT caching and what is the way to optimize this process?

We have about 700 odd XSLT files. Total size of these files is about 15 MBs. We invoke the pub.xslt.Transformations:transformSerialXML service about 100K time which uses one of files among these 700 files during each execution.

In the Heap Dump we found that the size of class com.wm.pkg.xslt.util.TemplatesCache has retain memory of 250 plus MBs. As caching of these template when using the built-in Transform Serial XML service is done internally we are assuming that WmXSLT Cache is growing with each time one of 700 template is called.

Will using the removeAllTemplates service often will reduce the size of object or there is more to do to bring the memory utilization low for the WmXSLT object?