Hi,

Well, it seems to me that there are 3 possibilities:
(a) 
the stylesheet processing just requires more memory than you are
allowing the jvm to allocate
(b)
there is a memory leak somewhere in your app that reduces available
memory to a low level so that the stylesheet fails, or
(c)
there is a "race condition" in xerces or xalan which is intermittently
causing it to go into infinite recursion or similar.

I am sure you realise that these kind of problems are difficult to
solve. Unless you can provide a simple test-case that can be used to
duplicate the problem (and I realise this is difficult), people on this
list are really limited to just offering a few suggestions of things you
could try.



Here's a method that will log the amount of memory available; I suggest
that you invoke this method just before you load or execute your
stylesheet. That should prove whether (b) is the problem or not.
Note that this method uses "log4j" logging; you may have to adapt this
to whatever logging mechanism is available in your environment.
    
    /**
     * Method which outputs to the log information about the amount of 
     * memory being used by the JVM as a whole; this may be useful in
     * detecting memory leaks.
     */
    private void logMemoryUsage()
    {
        if (!log.isDebugEnabled())
        {
            return;
        }
        
        Runtime rt = Runtime.getRuntime();
        long freeMemory = rt.freeMemory();
        long totalMemory = rt.totalMemory();
        long maxMemory = rt.maxMemory();

        StringBuffer buf = new StringBuffer(200);
        buf.append("memory usage:");
        buf.append(" free=");
        buf.append(freeMemory);
        buf.append(" total=");
        buf.append(totalMemory);
        buf.append(" maxMemory=");
        buf.append(maxMemory);
        buf.append(" used=");
        buf.append(totalMemory - freeMemory);
        
        log.debug(buf.toString());
    }


As for (c), it is possible that there is a bug in xerces or xalan that
causes all memory to be used. However I have a fairly heavily used app
that performs transforms in multiple threads, and runs for weeks without
restarts. I have not yet observed any "out of memory" problems, so there
is a fair chance that (a) or (b) is the cause of the issues you are
experiencing. However I am using Xalan 2.4.1 + Xerces 2.3.

Is it possible for you to upgrade to the latest xerces/xalan? I believe
Xalan 2.5 is now out...


Regards,

Simon


> [03.04.20 14:32:12:812 CST] 6902870a SystemOut     U
> java.lang.StackOverflowError
>  at java.lang.String.hashCode(String.java(Compiled Code))
>  at java.util.Hashtable.get(Hashtable.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>             :
>             :
>             :
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.util.Properties.getProperty(Properties.java(Compiled Code))
>  at java.lang.System.getProperty(System.java(Compiled Code))
>  at
> sun.security.action.GetPropertyAction.run(GetPropertyAction.java(Compiled 
> Code))
>  at java.security.AccessController.doPrivileged(Native Method)
>  at java.io.BufferedWriter.<init>(BufferedWriter.java(Compiled Code))
>  at java.io.PrintWriter.<init>(PrintWriter.java(Compiled Code))
>  at java.io.PrintWriter.<init>(PrintWriter.java(Compiled Code))
>  at
> org.apache.xalan.processor.TransformerFactoryImpl.<init>(TransformerFactoryImpl.java(Compiled
>  Code))
>  at
> org.apache.xalan.processor.TransformerFactoryImpl.<init>(TransformerFactoryImpl.java(Compiled
>  Code))
>  at java.lang.Class.newInstance2(Native Method)
>  at java.lang.Class.newInstance1(Class.java(Compiled Code))
>  at javax.xml.transform.FactoryFinder.newInstance(Unknown Source)
>  at javax.xml.transform.FactoryFinder.find(Unknown Source)
>  at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
>  at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.generateXML(AEHealthTestServlet.java:1070)
>  at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.createAmacisCampaignFile(AEHealthTestServlet.java:548)
>  at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.deliverEmailHealthTestMessage(AEHealthTestServlet.java(Compiled
>  Code))
>  at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.deliveryHealthTest(AEHealthTestServlet.java(Compiled
>  Code))
>  at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.performTask(AEHealthTestServlet.java(Compiled
>  Code))
>  at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.mainFunction(AEHealthTestServlet.java(Compiled
>  Code))
>  at
> com.hsbc.lht.glv.ae.src.AEHealthTestServlet.doGet(AEHealthTestServlet.java(Compiled
>  Code))
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
> Code))
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
> Code))
>  at
> com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.InvokerServlet.service(InvokerServlet.java(Compiled
>  Code))
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled
> Code))
>  at
> com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.ServicingServletState.service(StrictLifecycleServlet.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled
>  Code))
>  at
> com.ibm.servlet.engine.http11.HttpConnection.handleRequest(HttpConnection.java(Compiled
>  Code))
>  at
> com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled
>  Code))
>  at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled
> Code))
>  at com.ibm.ws.util.CachedThread.run(ThreadPool.java(Compiled Code))
> 
>  
> It seems that the stack overflow problem is due to the getproperties
> method is automically called repeatedly until all the stack are used
> up.
>  
> Any idea?
>  
> Thanks first.
>  
> Sherlane
>  
> 
> 
> 
> ______________________________________________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.

Reply via email to