Hi Akila,

There are lots of options for JVM tuning, and correct tuning really
depends on how your application uses the heap. Which version of java are
you using? If you are using JDK 1.5 (or higher), you should add these to
your startup options:

-Dcom.sun.management.jmxremote

Which will allow you to use jconsole, a good way to view how you are you
using the heap. In Sun's JDK, this tool is in $JAVA_HOME/bin - first run
"jps" to get the ID of the java process you want to monitor with
jconsole, then run jconsole with that ID as the argument. You should
then take some time to read about how Java breaks up the memory
available to the VM and how Java garbage collects:

http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html


One application I run under reason caches quite a bit of data in memory.
On a two processor Xeon, with 4GB of RAM, under 32bit RH, I run the
application with these JVM options:

-server 
-verbose:gc 
-Dcom.sun.management.jmxremote 
-XX:MaxPermSize=256m 
-XX:PermSize=256m 
-XX:+AggressiveHeap 


-verbose:gc has the VM log it's GCs to the jvm.log in $RESIN_HOME/log,
so I can see how often my application is garbage collecting. This is
especially useful in tracking how often full GCs are done. 

Passing the AggressiveHeap option is similar to the -Xms/mx options but
allows the JVM to inspect and tune the heap configuration by itself.
This will attempt to use as much memory as possible, so don't do it on
machine that is running any other services. 

The PermSize options are required when you have a great deal of classes
or other items that will not/cannot be garbage collected, ever. The JVM
puts these items in a special section of memory called the Permanent
Generation. The resin app I am passing these arguments to creates enough
items in the permanent generation to require that I size the generation
beyond the JVM defaults.




Thanks,

Adam Fletcher
Director, Information Technology
PowerSteering Software, Inc. 

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Akila
Amarathunga
Sent: Friday, December 29, 2006 9:55 AM
To: General Discussion for the Resin application server
Subject: Re: [Resin-interest] Resin java exception

Hi Adam,

well i did some searches in google and adjusted the JVM like below 

./httpd.sh -Xmn100M -Xms500M -Xmx500M

and test the application... After that i didn't get  heap exceptions...
Any ideas how to fine tune JVM memory..?

Thanks,
Akila

On Fri, 2006-12-29 at 09:35 -0500, Adam Fletcher wrote:
> Hi,
> 
> What JVM options are you using when you start up resin? Typically, an
> out of heap error means you're running out of virtual machine memory.
> You can tune the VM with the options you pass to resin in the httpd.sh
> script.  
> 
> 
> Thanks,
> 
> Adam Fletcher
> Director, Information Technology
> PowerSteering Software, Inc. 
> 
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Akila
> Amarathunga
> Sent: Friday, December 29, 2006 9:13 AM
> To: General Discussion for the Resin application server
> Subject: [Resin-interest] Resin java exception
> 
> Hi All,
> 
> I have RH system with apache 2.0 and resin 3.0. All the requests to
> Resin goes through apache using mod_caucho. When I do simultaneous
> searches i get a java exception call like below
> 
> java.lang.OutOfMemoryError: Java heap space
> 
> Complete stack:
> 
> wicket.WicketRuntimeException: Method onFormSubmitted of interface
> wicket.markup.html.form.IFormSubmitListener targeted at component
> [MarkupContainer [Component id = autoForm, page =
> tbt.engine.SearchingPage2, path = 0:autoForm.MyForm, isVisible = true,
> isVersioned = true]] threw an exception
>      at
>
wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:174
> )
>      at
>
wicket.request.target.component.listener.ListenerInterfaceRequestTarget.
> processEvents(ListenerInterfaceRequestTarget.java:74)
>      at
>
wicket.request.compound.DefaultEventProcessorStrategy.processEvents(Defa
> ultEventProcessorStrategy.java:65)
>      at
>
wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEve
> nts(AbstractCompoundRequestCycleProcessor.java:57)
>      at
> wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:846)
>      at
> wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:879)
>      at wicket.RequestCycle.step(RequestCycle.java:960)
>      at wicket.RequestCycle.steps(RequestCycle.java:1034)
>      at wicket.RequestCycle.request(RequestCycle.java:453)
>      at
wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:215)
> 
> Please help me out if any of you guys come through a exception like
> this.
> 
> Thanks,
> Akila
> 
> 
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
> 
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
> 


_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to