It’s quite common to run In memory problems when running some big Java EE application on a Tomcat server.
Some of the most commmon errors are like the following ones.
This is about a full Heap space:
SEVERE: Servlet.service() for servlet jsp threw exception java.lang.OutOfMemoryError: Java heap space
This other is about the PermGen space that’s a memory area, where compiled classes (and JSPs) are kept, and this error might happen often if the running web application have many .java and .jsp.
MemoryError: PermGen space java.lang.OutOfMemoryError: PermGen space
To increase the memory available to Tomcat, about heap and permgen the correct options are the following ones.
This sets the max heap available to Tomcat at 1Gb of memory:
--JvmMx 1024
This sets the max permgen available to Tomcat at 256Mb of memory:
-XX:MaxPermSize=256m
To change the Tomcat memory settings (when Tomcat is installed on Windows as system service), it’s required to use the command-line tool tomcat6. The next command changes the memory settings for the Tomcat service named Tomcat6
tomcat6 //US//Tomcat6 --JvmMx 1024 ++JvmOptions="-XX:MaxPermSize=256m"
The label //US//Tomcat6 has the meaning of Updating Server parameters for the service named Tomcat6.
Obviously this command should be executed from the directory C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin or from wherever is the bin directory of your Tomcat installation. Or to make things simple, that directoy should be added to your PATH environment variable.
It’s even possible to update memory settings from a GUI frontend, or to view what happened after running the command line tool. Running the following command:
tomcat6w //ES//Tomcat6
a window will open showing all the parameters about the windows service Tomcat6.
It’s possible to see in this image that, after running the previous command, for setting higher memory limits, in the sections Maximum memory pool and at the end of the Java Options the new memory limits are set.

Tomcat Memory Settings on Windows
good…
how to solve the same problem in Ubuntu..
when am executing the same command am getting the error like ” tomcat6 command not found ” in bin directory
tomcat6.exe is for Windows.
On ubuntu… I suggest to give you a look to catalina.sh, and set the $CATALINA_OPTS variable.
How do you run Tomcat on your ubuntu server?
Hi While Iam trying to run above command (tomcat6w //ES//Tomcat6) the window showing all the parameters is not opened and its giving me error …
[2011-07-25 14:39:52] [427 prunsrv.c] [error]
The operation completed successfully.
[2011-07-25 14:39:52] [1336 prunsrv.c] [error]
Load configuration failed
Please help us ASAP.
Thanks a ton.
I am able to resolve memory issue now. But i am unable to run tomcat6w //ES//Tomcat6, it gives me an error message telling that an instance of ‘ Tomcat is already running’ even though i have stopped it. Any tips to resolve this too.
I’m a little confused about how the maximum values por “maximum memory pool” are afected by the windows version or sistem’s memory size…
Thanks a lot. You are adorable. Such a nice help.
This article is by far the simplest and most effective I’ve found on this topic. Good going!
@shobha – Make sure that the Tomcat monitor is not running in the taskbar next to the clock. Double click on the monitor to see the config.
Thank you Thank you. Excellent tutorial. Solved my issue.
Thankyou for the post.
I am able to solve the issue.
Bulls Eye Hit. Thank you.
Great post, thanks for the tips!
foam poly vynal acetate topical spray for varicella zoster virus clobetasol .05 dangers of valium fever for five days no symptoms mlt memorex soma cod delivery ketoprofen injection biaxin clarithromycin qtc geodon xopenex in pediatrics astragalus extract applied computers natural analogs for geologic co2 sequestration pdi brand benzalkonium chloride packets flo beds can we measure serum thyroglobulin ehsan amin fludarabine cyclophosphamide regimen aplastic anemia tbi epi in imaging facial moisturizers with spf tobramycin ophthalmic cat c15 issues conjugation of estar synagis how long until effective what is doxycycline hyclate used for xenical weight loss medicine yakov zel dovich loratadine medicine apo definition fml is a omniform file extension ambrotose woolworths financial services gfs richard umbers asacol drug tory webber called drug protonix virgil brown ezetimibe 2008 vigamox how many times a day enbrel patient story dextromethorphan and phantom pain coughing up mucos trazodone side effects dose related acne medicine trinessa uaa homer skf actuation system cheap symbicort feline and avian skeletal systems pediasure in australia contac lens black oxide process free ferrets in florida psyllium husk bfad ammonia storage alendronate 35 ndc usnea tincture i need to order bacteriostatic water dimethyl sulfoxide 99.5 appetite supress weightloss drops avail shipping micardis nandrolone decanoate liver toxic stanozolol winstrol vitamins injectable rheem integrity c8 24 dane county wisconsin alcohol treatment programs valerian panic attacks horseshoe peg distance zolpidem somit side effects off atorvastatin generic finasteride identification codesp instructional aide tutorial uva enoteca predates woolly adelgid winstrol anadrol does propranolol erase memories foot toxin removal zanaflex flexeril clk wallpaper enteric coated aspirin coronary artery disease does accutane work sora no iro dyne test solutions james wands reme order vermox tablets plaster how-to repair holes sona nutrition zostavax local skin reactions high off focalin define articular cartilage tapazole tabs tandem tractors in the 60 s water jel fire blankets tazorac nra rifle qual patch papain safety dong quai root fever 1987 cruisers in chateau vee specs dow tordon rtu topiramate alcoholism ascorbic acid for swollen ankles
Thank you, thank you, thank you! I’ve been strugling with OutOfMemoryError for a while. Everywhere I’ve looked, the reference is to CATALINA_OPTS, but that did not change anything. The advice in this post fixed it!
Make sure that there is at least 1 blank space at the end of the setting on the previous line, and make sure that there are NO TRAILING SPACES after the 256m.
Just spent an hour trying find what was causing the following
[2011-03-25 13:37:54] [error] CreateJavaVM Failed
[2011-03-25 13:37:54] [error] The system could not find the environment option that was entered.
This is not a solution; this just buys you some time. If you run out of PermGen space this means your class files are not unloaded for some reason. You will still run out of PermGen space sooner or later.
It solves the problem when you app too big. Thank!
Nice post. Thanks.
Thanks, solves my problem
Pingback: Proxy Servers » Tomcat 7 getting CreateJavaVM Failed Error
Thank you it helped me !!!
Pingback: Install Pentaho 4.5 CE as service on Windows 7 x64 | Dot …