You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ulrich Mayring <ul...@denic.de> on 2000/02/10 18:33:49 UTC

Please help: Memory Leak

Hello,

I consistently get a java.lang.OutOfMemoryError when I reload XML pages.
It doesn't matter whether I use the supplied sample pages or my own. The
only factor seems to be the size of the XSL stylesheet - the larger it
is, the sooner this error will come up. If I use my own XML/XSL combo,
then memory already runs out with the first reload. If I use the
index.xml page from the supplied samples, then I need to reload 30-40
times to produce this error. It doesn't happen when

- loading the page for the first time after cocoon was started
- loading the page after loading another one successfully(*)

(*) this means that, if I load a page and memory runs out, then I can
load another (smaller) page successfully and after that can load the
original page again. There seems to be some garbage collection going on
after loading a page successfully.

I have the JDK 1.1.8 and page caching disabled in cocoon.

thanks for any pointers,

Ulrich

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

Re: Please help: Memory Leak

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Stefano Mazzocchi wrote:
> 
> > Try increasing the memory of your JVM...
> 
> I did try this, to no avail. My settings are:
> 
> in jserv.properties:
> 
> wrapper.bin.=/usr/local/bin/jdk118_v1/bin/java
> wrapper.bin.parameters="-ms1000000"
> 
> in cocoon.properties:
> 
> store.memory = 200000

Try

 store.memory = 2000000

(2 Mb, add zero at the end)
 
I have an idea on what might causes the trouble, but I need more tests
to find out what the right solution would be... Try playing around with
heap-size and store.memory combinations and tell us what you get. 

the exception won't probably go away, but I'm interested in knowing how
many pages you were able to serve before this happens, depending on your
JVM memory + store.memory perameters.

> Are there any other places, where I can set memory requirements? Also,
> what we have here is a memory leak, so I think increasing the memory
> cannot solve the problem, only put it off. In any case, increasing the
> memory of the JVM from the above setting to, say, 5000000 doesn't change anything.

No, it's not a memory leak. (pretty hard to do a memory leak in java)

It's a design flaw in the Java API that I had to program around in a
pretty nasty way... and sometimes it fails. Take a look at the store
classes if you care to know more about it.

Anyway, more tests will probably help us find out a better solutions
because i agree: what we have today does not scale as I would like to.

NOTE: cocoon2 will do much better being SAX based, but we still need a
better memory store model.

> Ulrich
> 
> --
> Ulrich Mayring
> DENIC eG, software development
> ulim@denic.de
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org


-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Re: Please help: Memory Leak

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

> I concur with ulrich, I went so far as:
> wrapper.bin.parameters=-ms64m
> wrapper.bin.parameters=-mx96m

Boy, overkill. Still, I tried these values as well, and the result was
exactly like I predicted: memory doesn't run out on the first reload,
but on the nth reload. It's a leak.

Ulrich

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

Re: Memory Leak resolved

Posted by Stefano Mazzocchi <st...@apache.org>.
Mark Washeim wrote:
> 
> on 11/2/2000 16.37, Ulrich Mayring at ulim@denic.de wrote:
> 
> > sim@sbs.bangor.ac.uk wrote:
> >>
> >> It could well be JVM/version related. I used to have memory
> >> related problems in my GSP pages with the Linux 1.1.6 port.
> >> They've gone for good since I started using the IBM 1.1.8
> >> JDK.
> >
> > I'm using the JDK1.1.8 for RedHat Linux 5.2 from Blackdown.org. Anyhow,
> > the problem seems resolved now, I got the newest developer version of
> > xalan (version 0_19_3D01) and that got rid of the memory problems. Maybe
> > they're put off into the far distant future, but for now I can use
> > cocoon :)
> >
> > Ulrich
> 
> Ok, I did as Ulrich has. Also resolved the memory leak.
> 
> My installation.
> 
> NetBSD 1.3.x and NetBSD 1.4.1
> Apache 1.3.9 & 1.3.4
> JDK 1.1.6
> Jserv 1.1b3
> Cocoon 1.6.1
> Xalan (version 0_19_3D01
> Xerces 1.0.1
> 
> Is functional. I'm doing benchmarking (I'll do it on the NetBSD 1.4.1 box
> first). I'll post my results.
> 
> First: apache bench, then Jmeter results.
> 
> I'll try to provide comparisons with other servlets and plain html file
> retrieval.

Ok, a little explanation here: what you guys were experiencing is _NOT_
a memory leak but a result of known behavior.

The Cocoon cache works like this:

1) stores everything in memory
2) leaves "store.memory" bytes for normal operation.

Xalan 0.19.2 is pretty memory hungry, so, in big stylesheets, you end up
needing more than 200kb, expecially when doing multiple requests. Latest
Xalan is probably more memory tuned, this is why your problems went away
(but will turn right out)

A better value should be around 2Mb, 200K is only for simple,
out-of-the-box installations.

Anyway, I'm working on a final solution for this.

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------



Re: Memory Leak resolved

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

> sim@sbs.bangor.ac.uk wrote:
>> 
>> It could well be JVM/version related. I used to have memory
>> related problems in my GSP pages with the Linux 1.1.6 port.
>> They've gone for good since I started using the IBM 1.1.8
>> JDK.
> 
> I'm using the JDK1.1.8 for RedHat Linux 5.2 from Blackdown.org. Anyhow,
> the problem seems resolved now, I got the newest developer version of
> xalan (version 0_19_3D01) and that got rid of the memory problems. Maybe
> they're put off into the far distant future, but for now I can use
> cocoon :)
> 
> Ulrich

Ok, I did as Ulrich has. Also resolved the memory leak.

My installation.

NetBSD 1.3.x and NetBSD 1.4.1
Apache 1.3.9 & 1.3.4
JDK 1.1.6
Jserv 1.1b3
Cocoon 1.6.1
Xalan (version 0_19_3D01
Xerces 1.0.1

Is functional. I'm doing benchmarking (I'll do it on the NetBSD 1.4.1 box
first). I'll post my results.

First: apache bench, then Jmeter results.

I'll try to provide comparisons with other servlets and plain html file
retrieval.

Thanks Ulrich!

-- 
Mark (Poetaster) Washeim

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

 



Re: Memory Leak resolved

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

> sim@sbs.bangor.ac.uk wrote:
>> 
>> It could well be JVM/version related. I used to have memory
>> related problems in my GSP pages with the Linux 1.1.6 port.
>> They've gone for good since I started using the IBM 1.1.8
>> JDK.
> 
> I'm using the JDK1.1.8 for RedHat Linux 5.2 from Blackdown.org. Anyhow,
> the problem seems resolved now, I got the newest developer version of
> xalan (version 0_19_3D01) and that got rid of the memory problems. Maybe
> they're put off into the far distant future, but for now I can use
> cocoon :)
> 
> Ulrich

I'm glad for you. Sadly, I'm going to have to switch to another machine.
But, Dev release of Xalan and 1.1.8 (NetBSD) it is.

Thanks a lot.
-- 
Mark (Poetaster) Washeim

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

 



Memory Leak resolved

Posted by Ulrich Mayring <ul...@denic.de>.
sim@sbs.bangor.ac.uk wrote:
> 
> It could well be JVM/version related. I used to have memory
> related problems in my GSP pages with the Linux 1.1.6 port.
> They've gone for good since I started using the IBM 1.1.8
> JDK.

I'm using the JDK1.1.8 for RedHat Linux 5.2 from Blackdown.org. Anyhow,
the problem seems resolved now, I got the newest developer version of
xalan (version 0_19_3D01) and that got rid of the memory problems. Maybe
they're put off into the far distant future, but for now I can use
cocoon :)

Ulrich

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

Re: Please help: Memory Leak

Posted by Simeon Walker <si...@sbs.bangor.ac.uk>.
> I concur with ulrich, I went so far as:
> wrapper.bin.parameters=-ms64m
> wrapper.bin.parameters=-mx96m
>
> which, in a unix universe make absolutely no sense. :(
>
> I wonder if it's OS/JVM related. I'm running:
> NetBSD 1.4.1
> JDK 1.1.6 (should move to 1.1.8)
>

It could well be JVM/version related. I used to have memory
related problems in my GSP pages with the Linux 1.1.6 port.
They've gone for good since I started using the IBM 1.1.8
JDK.

Simeon

--
---------------------------------------------------------------------
Simeon Walker,                      email: simeon@sbs.bangor.ac.uk
School of Biological Sciences,      phone: +44 (0)1248 383702
University of Wales, Bangor,        fax: +44 (0)1248 382569
Gwynedd, LL57 2UW, UK.              www: http://sbsweb.bangor.ac.uk/
---------------------------------------------------------------------


Re: Please help: Memory Leak

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

> Stefano Mazzocchi wrote:
> 
>> Try increasing the memory of your JVM...
> 
> I did try this, to no avail. My settings are:
> 
> in jserv.properties:
> 
> wrapper.bin.=/usr/local/bin/jdk118_v1/bin/java
> wrapper.bin.parameters="-ms1000000"
> 
> in cocoon.properties:
> 
> store.memory = 200000
> 
> Are there any other places, where I can set memory requirements? Also,
> what we have here is a memory leak, so I think increasing the memory
> cannot solve the problem, only put it off. In any case, increasing the
> memory of the JVM from the above setting to, say, 5000000 doesn't change
> anything.
> 
> Ulrich


I concur with ulrich, I went so far as:
wrapper.bin.parameters=-ms64m
wrapper.bin.parameters=-mx96m

which, in a unix universe make absolutely no sense. :(

I wonder if it's OS/JVM related. I'm running:
NetBSD 1.4.1
JDK 1.1.6 (should move to 1.1.8)

ix86 processor, 256 MB RAM

hmmm. I'll try to be methodical in testing apache bench against samples
included with the distribution.

-- 
Mark (Poetaster) Washeim

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

 



Re: Please help: Memory Leak

Posted by Ulrich Mayring <ul...@denic.de>.
Stefano Mazzocchi wrote:

> Try increasing the memory of your JVM...

I did try this, to no avail. My settings are:

in jserv.properties:

wrapper.bin.=/usr/local/bin/jdk118_v1/bin/java
wrapper.bin.parameters="-ms1000000"

in cocoon.properties:

store.memory = 200000

Are there any other places, where I can set memory requirements? Also,
what we have here is a memory leak, so I think increasing the memory
cannot solve the problem, only put it off. In any case, increasing the
memory of the JVM from the above setting to, say, 5000000 doesn't change anything.

Ulrich

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

Re: Please help: Memory Leak

Posted by Stefano Mazzocchi <st...@apache.org>.
Ulrich Mayring wrote:
> 
> Hello,
> 
> I consistently get a java.lang.OutOfMemoryError when I reload XML pages.
> It doesn't matter whether I use the supplied sample pages or my own. The
> only factor seems to be the size of the XSL stylesheet - the larger it
> is, the sooner this error will come up. If I use my own XML/XSL combo,
> then memory already runs out with the first reload. If I use the
> index.xml page from the supplied samples, then I need to reload 30-40
> times to produce this error. It doesn't happen when
> 
> - loading the page for the first time after cocoon was started
> - loading the page after loading another one successfully(*)
> 
> (*) this means that, if I load a page and memory runs out, then I can
> load another (smaller) page successfully and after that can load the
> original page again. There seems to be some garbage collection going on
> after loading a page successfully.
> 
> I have the JDK 1.1.8 and page caching disabled in cocoon.
> 
> thanks for any pointers,

Try increasing the memory of your JVM...

-- 
Stefano Mazzocchi      One must still have chaos in oneself to be
                          able to give birth to a dancing star.
<st...@apache.org>                             Friedrich Nietzsche
--------------------------------------------------------------------
 Come to the first official Apache Software Foundation Conference!  
------------------------- http://ApacheCon.Com ---------------------