Harald Henkel a écrit :

> Hello everybody.
>
> How can I increase the memory Tomcat/Java is using?
>
> I tried setting CATALINA_OPTS with -server -Xms256m -Xmx512m
> but runtime.totalMemory always seems to return a value around 60MB.
>
that mean the java machine did not require more. the 512M is reflected
in runtime.maxMemory()
There are several reasons for an out of memory message:

1) maxMemory() has been reached (according to your message this doesn't
seems the case, unless you didn't check memory during loading process
and you ended up filling java memory with the whole database)
2) jvm encountered a system memory exhaustion: you say java can use
512M, but system memory available in both physical memory and swap space
is less (not very likely, and you will probably encounter problem with
other applications if it was the case)
3) ran out of permgen size. Most likely to happen if you do several
reload of your webapp and the webapp has classloader memoryleaks issues
(has been discussed lots of times on this mailing lsit, search the
mailing list history)
4) More funny, a java.lang.OutOfMemoryError can also occur when you run
out of process threads (Each OS has a maximum to the number of threads a
process can create.  For HP-UX we discovered with java this was around
4096 threads :p)

> And there are some operations (exporting several thousand database
> records to an Excel file) where we receive out of memory errors.
> Unfortunately I don't yet know the exact error text and where it is
> displayed...
>
> Yet, if the server (including database) is rebootet it works, so it
> seems to be a problem with Tomcat (oracle doesn't seem to have a problem,
> because the data is already dispalyed in a table genereated by tomcat
> (JSP).
> Only if I try to export this data to an exel file, the problem arised.

Look closely at your code, add debug statements about available memory
during export process, use a profiling tool to find where your memory
goes, run tomcat in a debugger and interrupt on outofmemoryexception.
This is most probably a problem with the web application, not with
tomcat. Check your code.

>
> This is on Windows XP Pro SP2.
>
> Anybody got an idea? Can this be due to Tomcat memory management? How
> to change it correctly on windows ?
>
> Somewhere I saw -ms and -mx insead of -Xms and -Xmx
>
> Any help appreciated!
>
> With kind regards,
> Harald Henkel
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to