Try doing some caching of your own (in Java) for calls that do expensive I/O operations.. E.g. livesite caches the final page output, but it reloads that whole 2MB sitemap for every new page, so if you cache it in your Java code, you spare yourself a lot of allocations and delayed garbage collection.Beyond that, you may need to look at memory profiling. Java Melody is a great little tool for the basics (https://code.google.com/p/javamelody/) but if you really want to dig into the matter, you'll need a real profiler (e.g. JProfiler).Word of warning: LiveSite destroys any org.dom4j.Document returned by an External upon rendering, so if you're caching the sitemap Document and that's what you're returning unmodified, you'll want to "return (Document) doc.clone()" instead. Kinda beats the point of sparing the allocation but at least you save on the I/O and parsing?