cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robin Green" <>
Subject Re: Memory Utilization Of Cocoon & Tomcat
Date Wed, 09 Aug 2000 11:51:42 GMT wrote:
>      Can anybody tell me the basic requirement for cocoon & tomcat 
>Where there will
>be 1000 concurrent connections.

1000 simultaneous connections?! Firstly, Tomcat may not yet be mature enough 
to handle that kind of high load. Perhaps you should use a commercial tool 
like JRun instead.

We had Tomcat crash on our Linux webserver on quite low load conditions. The 
same setup with JServ caused no problems, but JServ is not recommended 
because it is no longer being developed.

>I am testing a small application which was developed using cocoon. I did my
>experiment like this. I have
>written a small xml document holding bulk information (10k) and a xsl 
>which will display different
>segments of the data in each and every request. I am substringing the xml 
>during transformation and
>displaying the data to the client.

If you are doing a lot of string concatenation, you can slightly increase 
memory efficiency and speed by using StringBuffers as much as possible. 
(They are used internally by Java anyway, but the compiler is not very 
efficient). Ideally only one StringBuffer per request.

>      I made continuous request to the xml file. i found the mem 
>keeps on increasing.

Yes. That is because JDK1.1 doesn't have effective cache management, and 
Cocoon is designed to be compatible with 1.1. So the cache keeps on growing. 
Don't worry though, when the memory reaches the maximum, Cocoon will start 
clearing out the cache. Your users will just experience pauses, maybe not 
even noticeable ones.

To avoid the system slowing down through disk thrashing you should ensure 
that the JVM's maximum memory, set at the command line by -mx on JDK1.1 or 
-Xmx on JDK1.2 and JDK1.3, is at a sensible level, e.g. 64Mb on a 128Mb 

If all/most of your pages use XSP and you don't specify the hasChanged() 
method in XSP pages to enable caching, then pages will be stored but never 
retrieved, so there is no point in having a cache and you can turn it off in 
the file, by commenting out Cache and uncommenting 

If you turn off caching, memory usage will still increase, but it should be 
reclaimed automatically by the Java garbage collector. Most VMs do not 
return memory to the operating system however so you will not see the memory 
indicator decrease in WinNT Task Manager or ps or top in Unix.

Robin Green
i-tao Ltd.
4 Skyline Village
London E14 9TS
United Kingdom
Phone +44 20 7537 2233  Fax +44 70 8081 5118

Get Your Private, Free E-mail from MSN Hotmail at

View raw message