Here is my version of what happens in Q&A.

* What does out of memory error mean?
  - Java virtual machine (which runs tomcat which runs xwiki) has run out of heap space and cannot allocate anything anymore.

* Is it related to MySQL packet size?
  - No

* Why this error happens?
  - Because application needs more memory than JMV is allowed to use.

* How is that related to attachments?
  - The way xwiki handles attachments is, well, not perfect.
  Somewhat related thread is http://lists.xwiki.org/pipermail/users/2007-November/009362.html

* So what can you do?
  - a) Use -Xms and -Xmx java parameters to increase heap size.
  - b) Implement and contribute to XWiki effective attachment handling.

* What are the -Xms and -Xmx params?
  - -Xms tells java the initial heap size, -Xmx controls max size. The latter is of special interest in this case and can be increased.

Pavel

On Feb 16, 2008 4:24 PM, <Dowson_Jim@emc.com> wrote:
Ricardo Rodriguez wrote:

>>Dowson_Jim@emc.com wrote:
>> An MS Word document.
>>
>> The error also happened with a 6.5 MB zip file - so the xwiki limit
of
>> 10MB may not be the issue (although documents larger than the alleged
>> 1MB MySQL limit have been successfully uploaded).

>Thus, the problem may arise from the amount of memory available for
>Java. What servlet container are you using? I've seen this error here
>running Tomcat. You can increase this amount by passing this parameter
>"-Xmx256m -Xms256m" (in this case 256Mb will be the new amount of
>available memory) at startup time.

I'll have to check with the lab folks - I believe they started with the
1.2M2 Windows complete build, then upgraded to 1.2RC2.

I will let you know after I have heard from them.

I wanted to make the changes one step at a time to isolate the root
cause.

>So, you have to shutdown your servlet container, modify some script to
>startup.sh, catalina.sh or whatever your are using to launch Tomcat, to

>>add this paramenters to CATALINA_OPTS or JAVA_OPTS. I have not a clear

>idea about what is the right variable to be modified. Any feedback will

>be really welcome.

> Here is the script I am using here to start Tomcat:

>mire:/home/webmaster/bin # cat start_tomcat6
>#!/bin/sh
>export CATALINA_HOME=/usr/share/tomcat-6.0.10
>export JAVA_HOME=/usr/share/java/jre-1.6.0_01
>export JRE_HOME=/usr/share/java/jre-1.6.0_01
>export CATALINA_OPTS="-Xmx512m -Xms512m"
>export JAVA_OPTS="-Xmx512m -Xms512m"
>$CATALINA_HOME/bin/startup.sh

>As per your question about the need of restarting XWiki so that the new

>configuration values become effective. Yes, this is required. xwiki.cfg

>is read at deployment time. So if you have any utility that allow you
to
>restart just one application, you are a lucky person :-) If you have
not
>it, just restart the servlet container.

I expected that to be the case - and the FAQ should be updated to
reflect that
(I didn't consider myself as authoritative, so I didn't want to edit the
entry).

I would also suggest that the error code (Java ....) be added to the
text as well.

>I am sure there are people out there with a much more in depth
knowledge
>about this issue. But this has helped me. I hope it could be useful for

>you as well.

Perhaps, but by speaking, you're the most effective person ;-)

I'll update you (here) after we apply the changes and test again.

Thanks for your help!
_______________________________________________
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users