Hi there, I'm hoping that someone can help me with a memory/threading problem im having with Tomcat. I have an application that does a lot of heavy xml processing and I'm trying to make this work as a web app within Tomcat. Basically I have a process that does the following:
1. Loads an xml file into the DOM 2. Xpaths to find a list of particular Nodes 3. For each Node run an XSL transform on the document to generate an individual html page For example, I have a 3mb xml document that i run through this process which generates 54 html pages. I've encapsulated this process in a class that implements the Runnable interface so i can kick the process off in a new thread (as it can take some time) and when I run the process on my local machine in Eclipse the memory usage ramps up to around 70mb until it completes. Now i reckon this is acceptable considering the amount of work thats going on. The problem comes when i try to invoke my Runnable class from a servlet. Tomcat goes crazy with the memory usage fluctuating wildly between 50-450mb and by the time the process has completed (which it does) my Tomcat.exe is hogging over 400mb of memory and refuses to give it up, which means i'm left with no alternative but to restart. My understanding of the servlet lifecycle is that for each requst to a servlet a new instance of the servlet class is created in its own thread and that the servlet container my maintain a pool of these threads, reusing them as requests come in. What i'm not sure about is what happens to any threads that the servlet may create (as in my case) It would seem that Tomcat is preventing my xml processing thread from being properly cleaned up. If any one has any ideas/suggestions i'd be most grateful Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
