You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Washeim <es...@canuck.com> on 2000/02/11 00:55:06 UTC

OutOfMemoryError(s)

I've noted a behaviour which someone on list also noted yesterday.

When navigating through a set of pages which all apply the same stylesheet
(all cocoon pis are in place) processing appears to work most of the time
and then fails with the following.

------
java.lang.OutOfMemoryError
    at java.io.BufferedWriter.<init>(BufferedWriter.java:102)
    at java.io.BufferedWriter.<init>(BufferedWriter.java:85)
    at java.io.PrintWriter.<init>(PrintWriter.java:110)
    at 
org.apache.xalan.xpath.xml.ProblemListenerDefault.<init>(ProblemListenerDefa
ult.java:67)
    at org.apache.xalan.xpath.DOMXPath.<init>(SimpleNodeLocator.java:1925)
    at 
org.apache.xalan.xpath.SimpleNodeLocatorFactory.create(SimpleNodeLocator.jav
a:1944)
    at org.apache.xalan.xslt.Stylesheet.createXPath(Stylesheet.java:1336)
    at org.apache.xalan.xslt.ElemValueOf.<init>(ElemValueOf.java:104)
    at 
org.apache.xalan.xslt.StylesheetHandler.startElement(StylesheetHandler.java:
705)
    at org.apache.xalan.xpath.xml.TreeWalker.startNode(TreeWalker.java:188)
    at org.apache.xalan.xpath.xml.TreeWalker.traverse(TreeWalker.java:90)
    at 
org.apache.xalan.xslt.XSLTEngineImpl.processStylesheet(XSLTEngineImpl.java:6
58)
    at org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:507)
    at 
org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.ja
va:94)
    at 
org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java:10
3)
    at org.apache.cocoon.Engine.handle(Engine.java:284)
    at org.apache.cocoon.Cocoon.service(Cocoon.java:145)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.run(JServConnection.java:359)
 -------   

2 of 5 pages have the larger content models where the XSL stylesheet applies
some conditionals to transform the node. The failure is inconsistant.
Although the content model shifts the position of some of the nodes, the
content is otherwise identical (a node called article) just in different
parents. It does, seem to by a Stylesheet problem, I just can't isolate it,
since the error creeps up unexpectadly. Sometimes just refreshing the
browser solves the problem.

Cocoon reports the following vis-a-vis memory:
Free Memory    2254784
Total Memory    13103096

-- 
Mark (Poetaster) Washeim

'In Xanadu did Kublai Khan
 A stately pleasure dome decree . . .'

 



Re: OutOfMemoryError(s)

Posted by Ulrich Mayring <ul...@denic.de>.
Mark Washeim wrote:

> Quite literally, the Out of memory condition takes place. I hit refresh,
> out
> of memomory, refresh, out of memory, refresh PRESTO!?!?! (Shift refresh)

So you get the correct page again with shift-refresh and the out of
memory with plain refresh?

Strange. I'll try to install the newest Xalan and see if that helps. If
you (or anyone else on this list) wants to try my pages, which produce
the out of memory on the first reload, I can post them. It would be
interesting to see, if the error can be reproduced on other machines.

I'll also try your pages, if you want to send them to me.

cheers,

Ulrich

-- 
Ulrich Mayring
DENIC eG, software development
ulim@denic.de

Re: OutOfMemoryError(s)

Posted by Mark Washeim <es...@canuck.com>.
on 11/2/2000 01.47, Ulrich Mayring at ulim@denic.de wrote:

> Mark Washeim wrote:
> 
>> parents. It does, seem to by a Stylesheet problem, I just can't isolate it,
>> since the error creeps up unexpectadly. Sometimes just refreshing the
>> browser solves the problem.
> 
> If it's the same problem I have, then refreshing the browser shouldn't
> work (if the cocoon page cache is disabled, otherwise you'll get the
> cached page on a refresh).

Quite literally, the Out of memory condition takes place. I hit refresh, out
of memomory, refresh, out of memory, refresh PRESTO!?!?! (Shift refresh)

> I did this test: deleted stuff liberally from my stylesheet. I then
> found that it doesn't matter what portions of the stylesheet I delete,
> but it matters *how much* code I eliminate. Even if I eliminate
> unused(!) templates, the memory situation becomes better (meaning I have
> to reload more often in order to run out of memory).

I'll try to do the same. I'd guess we'll see the same results.

> If you need to kill some time, try to reload the index page from the
> supplied samples a few hundred times and you'll run out of memory there
> as well (at least I do).
> 


I'll try running apache bench against the index page under a couple of
different scenarios (ie., total requests, concurrent requests, etc). I did
this last night against the xsp/page.xml file. Not too encouraging. Of
course, I'm not discounting the environment. I'll post results.

Thanks and regards,

-- 
Mark (Poetaster) Washeim

'In Xanadu did Kublai Khan
 A stately pleasure dome decree . . .'

 



Re: OutOfMemoryError(s)

Posted by Ulrich Mayring <ul...@denic.de>.
Mark Washeim wrote:

> parents. It does, seem to by a Stylesheet problem, I just can't isolate it,
> since the error creeps up unexpectadly. Sometimes just refreshing the
> browser solves the problem.

If it's the same problem I have, then refreshing the browser shouldn't
work (if the cocoon page cache is disabled, otherwise you'll get the
cached page on a refresh). 

I did this test: deleted stuff liberally from my stylesheet. I then
found that it doesn't matter what portions of the stylesheet I delete,
but it matters *how much* code I eliminate. Even if I eliminate
unused(!) templates, the memory situation becomes better (meaning I have
to reload more often in order to run out of memory).

If you need to kill some time, try to reload the index page from the
supplied samples a few hundred times and you'll run out of memory there
as well (at least I do).

Ulrich

-- 
Ulrich Mayring
DENIC eG, software development
ulim@denic.de