cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <>
Subject Re: Battling with null pointer exception
Date Mon, 03 Feb 2003 12:44:10 GMT
Derek Hohls dijo:
> Antonio
> Not sure we have more memory on the server, but I can try...
> The current  CATALINA_OPTS looks like:
> -Dawt.toolkit=com.eteks.awt.PJAToolkit
> -Djava2d.font.usePlatformFont=false
> -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
> -Djava.awt.fonts=/usr/java/jre/lib/fonts
> -Duser.home=/usr/local/pja -cp /usr/java/jre/lib/ext/pjatools.jar'
> Can I just add your parameter to the front or end of these commands?


CATALINA_OPTS='-Xmx256m -Xbootclasspath/a:/usr/local/pja/lib/pja.jar
 -Duser.home=/usr/local/pja -cp /usr/java/jre/lib/ext/pjatools.jar'

Please check that you have memory enough emory. Cocoon is a memory eater.
lol :-D But be carefully to dont give it more memory as you have, because
you can start swaping on the server. If you start swapping => You will see
too slow responses time.

By the way currently memory is very cheap. If you can try to config your
sever with 512MB or more. I had the same problem:

A-First we used in production a old machine Pentium III 500MHz. with 128
MB. We always get the Out of memory.
B-Then we upgraded to 384 MB and tweaking the server to use 256MB as I
recommended you. That was a lot of improvement, but sometimes slow. I
think this server can be fineright now with all the performance check and
rewriting we did on the XSP code.
C-Now we are using a PIV 1.8GHz, 512MB and it is very fast and all is OK.
Always we setted for him 256MB for Cocoon. We done some test. If you are
trying to show a table with aprox 10,000 rows. It takes 1 minut.

Also be aware that you must tweak the parameters of you database to get
the best time response.

We are using PostgreSQL 7.2 (on Red Hat Linux 8.0). After tweaking some
params, then the responses does not take more than some milisecs. That
means that all the 1 minut of the HTML table with 10,000 is expended in
XSL transformations.

I will also add that XSL is fine, but try to make the stylesheets the most
simple as you can.

For example: Before we used XSL to build dates from the database format
TIMESTAMP to a more human format: "25/12/2003 8:15". It was taking too
much time.

Then we rewrite the query to let the database to give us the format as we
want.It was a really improvement. Why? simple: The Database Manager code
is compiled to machine code. There is no virtual machine between. Then it
runs faster.

By the way, I saw that this kind of tricks are hidden and almost no where
you can find about it. I spend more than 15 days investigating about
that.... until I found some trick in a Tomcat book. I own the 3 already
books about Cocoon. The best book that cover the tweaking for production
environment is the book from Lajos and Jeremy. It helps me to understand
all this stuff.

If all this helps, please write a page on wiki about this. ;-)

I hope it will help you.

Best Regards,


> Thanks
> Derek
>>>> 03/02/2003 01:54:16 >>>
> Derek Hohls dijo:
>> I have an XSP page, containing ESQL; it works fine on my
>> test machine which has a relatively small subset of data,
>> but gives errors on the production machine with the full
>> database.
> OK. I suppose:
>   1-You have 5,000+ rows in your current DB.
>   2-The code in the XSP page works fine in your develpment machine.
> Solution:
>   1-Give more memory to Tomcat and Cocoon.
> Detail:
>   Suppose you can give 256 MB to Cocoon. then:
>     1-For Tomcat, in TOMCAT_ROOT/bin/
>          CATALINA_OPTS='-Xmx256m'
>        Also you need to tell Cocoon about that. In cocoon.xconf,
> search
> for store-janitor:
> <store-janitor logger="">
>      <parameter name="freememory" value="10000000"/>
>      <parameter name="heapsize" value="256000000"/>
>      <!-- How often shall the cleanup thread check memory -->
>      <parameter name="cleanupthreadinterval" value="15"/>
>      <!-- Indicates the thread priority of the cleanup thread -->
>      <parameter name="threadpriority" value="5"/>
>      <!-- How much percent of the elements of each registered Store
> shall
>      be removed when low on memory. Default 10% -->
>      <parameter name="percent_to_free" value="10"/>
>   </store-janitor>
> More recommendations:
>   1- Upgrade to Tomcat 4.1.18
> Finally Restart Tomcat! I hope it will help.
> Best Regards,
> Antonio Gallardo.
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <>
> To unsubscribe, e-mail:     <>
> For additional commands, e-mail:   <>
> --
> This message has been scanned for viruses and dangerous content by
> MailScanner, and is believed to be clean.
> "The CSIR exercises no editorial control over E-mail messages and/or
> attachments thereto/links referred to therein originating in the
> organisation and the views in this message/attachments thereto are
> therefore not necessarily those of the CSIR and/or its employees.   The
> sender of this e-mail is, moreover, in terms of the CSIR's Conditions of
> Service, subject to compliance with the CSIR's internal E-mail and
> Internet Policy."

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message