Hi Will, Here are fixes for issue 223 only. Issue number 223, Velocity Engine uses excessive amount of memory when a large number of directives and macros are used.
When a macro or directive is used, they are parsed at run time and the same macro will be parsed every time it is invoked from another macro. This results in an explosion of the duplicated string images. We introduce a string image pool. Before a string image is returned from VelocityCharStream GetImage method, we simply checks against the string image pool. If the string image exists in the pool, we will return the image from the pool. Otherwise we simply return the image itself. We observe a 30% memory footprint reduction after this. http://www.nabble.com/file/7592/StringImagePool.java StringImagePool.java http://www.nabble.com/file/7590/VelocityCharStream-patch.txt VelocityCharStrea http://www.nabble.com/file/7591/VelocityCharStream.java VelocityCharStream.java m-patch.txt Thanks. -- Lei -- View this message in context: http://www.nabble.com/Fixes-for-issue-223-only---resubmitted-tf3497189.html#a9768129 Sent from the Velocity - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
