How to specify maximum memory usage for Java VM in Tomcat?

Does any one know how to setup memory usage for Java VM, such as "-Xmx256m" parameter, in Tomcat?
I'm using Tomcat 3.x in Apache web server on Sun Solaris platform. I already tried to add the following line into tomcat.properties, like:
wrapper.bin.parameters=-Xmx512m
However, it seems to me that this doesn't work. So, how about if my servlet will consume a large amount of memory that exceeds the default 64M memory boundary of Java VM?
Any idea will be appreciated.
Haohua

With some help we found the fix. You have to set the -Xms and -Xmx at installation time when you install Tomcat 4.x as a service. Services do not read system variables. Go to the command prompt in windows, and in the directory where tomcat.exe resides, type "tomcat.exe /?". You will see jvm_options as part of the installation. Put the -Xms and -Xmx variables in the proper place during the install and it will work.
If you can't uninstall and reinstall, you can apply this registry hack that dfortae sent to me on another thread.
=-=-=-=-=-=
You can change the parameters in the Windows registry. If your service name is "Apache Tomcat" The location is:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache Tomcat\Parameters
Change the JVM Option Count value to the new value with the number of parameters it will now have. In my case, I added two parameters -Xms100m and -Xmx256m and it was 3 before so I bumped it to 5.
Then I created two more String values. I called the first one I added 'JVM Option Number 4' and the second 'JVM Option Number 5'. Then I set the value inside each. The first one I set to '-Xms100m' and the second I set to '-Xmx256m'. Then I restarted Tomcat and observed when I did big processing the memory limit was now 256 MB, so it worked. Hope this helps!
=-=-=-=-=
I tried this and it worked. I did not want to have to go through the whole reinstallation process, so this was best for me.
Thanks to all who helped on this.

Similar Messages

  • How to find native memory usage for a domain

    Hi All,
    We want to know how to find out current native momory utilization for a perticular weblogic domain. Basically we want to increase our current JVM heap size from 2 GB to 3.5GB because of 32 bit JDK restriction we are not having confident to increase at the memont. If we can get the current native memory utization then we will have a idea how to pregess and change in production env.
    OS - Solaris 10
    Weblogic - 9.2
    Java - 1.5
    Thanks and Regards
    Dinabandhu

    920767 wrote:
    Basically we want to increase our current JVM heap size from 2 GB to 3.5GB because of 32 bit JDK restriction we are not having confident to increase at the memontSurprisingly enough to me that will not work. The maximum on solaris is 2G presuming you are running on a 32 OS.
    http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_heap_32bit
    We want to know how to find out current native momory utilization for a perticular weblogic domainMemory is per process. Weblogic, the server, is one process (one VM.) Thus you can't increase the application memory for only part of it. I doubt weblogic has a way to limit it by app.

  • How to change heap memory size for general java applications (not applets)

    Hi. I made a java class which manipulates images and I sometimes get an out of memory error when the files are large. In these cases I can run it successfully from the command line using:
    java -Xms32m -Xmx128m myappbut as I run this class from a firefox extension, I can't use this technique.
    Could some one tell me how to set this globally? I've found a lot of info on setting it for applets in the control panel but that's it. I also tried editing my deployment.properties file by adding:
    deployment.javapi.jre.1.6.0_11-b03.args=-Xmx128mbut none of these options seem to work.
    Thanks for any help.

    Also you can use use [JAVA_TOOL_OPTIONS|http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#tooloptions], with more documentation here. JAVA_TOOLS_OPTIONS is available since 1.5. There is no direct documentation on [_JAVA_OPTIONS|http://java.sun.com/j2se/1.5.0/docs/guide/2d/flags.html] but was made available since at least 1.3.
    The recent existing forum thread [Java Programming - How to change the default memory limits for java.|http://forums.sun.com/thread.jspa?threadID=5368323&messageID=10615245&start=36] has a long discussion on the issue.
    You specified you are not using applets, but if you do, I would also suggest you use the next Generation Plug-in (since 1.6.0_10) that allows you specify the max memory in the applet without having to instruct the user how to make the change. See [JAVA_ARGUMENTS|https://jdk6.dev.java.net/plugin2/#JAVA_ARGUMENTS] for applets. Java Webstart uses resources.

  • How to capture memory usage for web application

    In OATS openscripts, how to capture memory usage for web application? Does it have the exisitng java method that we can call to get the memory data (e.g. peak bytes, private bytes) consumed by web application?

    JProbe

  • How to find out CPU and memory usage for an instance?

    Hi DBA Gurus,
    How to find out CPU usage and memory usage for an instance?
    Any information is appreciated!
    Thank you!
    Robert

    you can calculate cpu usage by adding fallowing three factors which you can get from v$sysstat
    1. Parse CPU time : This represents the percentage of CPU time spent parsing SQL statements. Parse time CPU can be a strong indication that an application has not been well tuned. High parse time CPU usually indicates that the application may be spending too much time opening and closing cursors or is not using bind variables.
    2. Recursive CPU time : Sometimes, to execute a SQL statement issued by a user, the Oracle Server must issue additional statements. Such statements are called recursive calls or recursive SQL statements. For example, if you insert a row into a table that does not have enough space to hold that row, the Oracle Server makes recursive calls to allocate the space dynamically if dictionary managed tablespaces are being used.
    Recursive calls are also generated due to the inavailability of dictionary info in the dictionary cache, firing of database triggers, execution of DDL, execution of SQL within PL/SQL blocks, functions or stored procedures and enforcement of referential integrity constraints
    3. Other CPU time : This represents the percentage of time spent looking for buffers, fetching rows or index keys, etc. Generally, \"Other\" CPU should represent the highest percentage of CPU time out of the total CPU time used.
    total memory used you can calculate adding
    total_agrigate_area+sga
    memory usage on os level you can know by fallowing commands
    vmstat 5 20 depending upon os

  • HOw to create a Batch file for java application and whats the use of this ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    First of all, you're OT.
    Second, you can find this everywhere in the net.
    If you got a manifest declaring main class (an classpath if needed), just create a file named whatever.bat, within same directory of jar file, containing:
    javaw -jar ./WhateverTheNameOfYourJarIs.jar %*By the way, assuming a Windows OS, you can just double click the jar file (no batch is needed).
    Otherwise use:
    javaw -cp listOfJarsAndDirectoriesSeparedBySemiColon country/company/application/package/className %*Where 'country/company/application/package/' just stands for a package path using '/' as separator instead of '.'
    Don't specify the .class extension.
    Javaw only works on Windows (you asked for batch, I assumed .BAT, no .sh), in Linux please use java.exe (path may be needed, Windows doesn't need it 'cause java's executables are copied to system32 folder in order to be always available, see PATH environment variable if you don't know what I'm talking about) and use ':' as classpath (cp) separator.
    The '%***' tail is there in order to pass all parameters, it only works on Windows, refer to your shell docs for other OSs (something like $* may work).
    This way you have a command you can call to launch your code (instead of opening NetBeans just to see your app working). You could schedule tasks on it or just call it in any command prompt (hope you know what it is 'cause there have been people in this very same forum with no clue about it, if not just hold the 'Windows button' and press 'R', then type 'cmd' and run it).
    Finally add dukes and give 'hem away.
    Bye.

  • How to create a Batch file for java application  ?

    HI,
    How to create a Batch file for java application ?
    And whats the use of creating batch file ?
    Thanks in advance

    [http://static.springsource.org/spring-batch/]
    Assuming you want to develop a batch application rather than actually just create a .bat file ..

  • How to create the exe file for java project.

    How to create the exe file for java project.
    am done the project in java swing , i like to create the project in exe format, so any one help for me,
    send the procedure for that.
    thanking u.

    How to create the exe file for java project.Have you ever heard of google? I pasted your exact "question" into a google search:
    http://www.google.com/search?q=How+to+create+the+exe+file+for+java+project.
    and got several useful links.
    Better search terms might yield even better results.
    Sheesh.

  • So how to specify different answer file for different install images in WDS snap-in?

    hello
    in WDS snap-in, in properties on server name, on client tab, we can define an answer file for unattended windows installation on WDS clients.
    my question is, maybe we have added multiple images in WDS snap-in (win xp image, win 7 , win 2008,...)
    now this one answer file applies to all of them ?
    so how to specify different answer file for different install images in WDS snap-in?
    thanks in advanced 

    Under the "Client" tab of WDS, you should only use an answer-file with settings relevant for the installation. This would be credentials for the WDS deployment share, international settings used during the setup and possibly also destination drive
    details (if you want the installation to take care of partitioning the disk etc). The settings relevant for unattend-files used under "Client" would only be of those in phase 1 (WinPE).
    However, if you would like to have specific unattend file for every installation, e.g. Win7, Server 2008, Win 8 etc, you can browse to the image under "Install Images" under the image Groups. There you can select properties for every image and
    have a personal unattend-file.
    hi Joel
    very cool. thanks a lot, that really helped me.
    best regards

  • How to create the exe files for java application

    How to create the exe file for java application?
    got any software to do that?
    Thanks

    In terms of converting java applications into exe files, there are 3 schools of thought:
    1) Instead of converting it to an exe, convert it to a jar file. Jar files are more portable than exe files because they can be double-clicked on any operating system. The caveat is that a Java interpreter must be installed on the target computer for the double-clicking to work.
    http://developer.java.sun.com/developer/Books/javaprogramming/JAR/
    2) Create an exe launcher that, when double-clicked, attempts to find a Java interpreter on the local computer and launches the Java application. The exe file is still double-clickable but whether your java application runs depends on whether a Java interpretor is installed on the target computer.
    http://www.sureshotsoftware.com/exej/
    http://www.objects.com.au/products/jstart/index.jsp
    http://www.duckware.com/products/javatools.html
    http://www.ucware.com/jexec/
    http://www.rolemaker.dk/nonRoleMaker/javalauncher/
    http://www.jelude.cjb.net/
    http://thor.prohosting.com/~dfolly/java/index.html
    3) Create an exe launcher that bundles a Java interpretor. Same as above but when the exe file is double-clicked, it searches for a Java interpreter and if one is not found, it installs one on the target computer. The caveat is that the exe file would have an overhead of 10 MB in size for the interpreter.
    http://www.excelsior-usa.com/jet.html (evaluation version available)
    4) Convert the Java application into a native exe file. The caveat is that if you use Swing for your GUI, it won't be converted. Also this option is still somewhat experimental.
    Can't think of any free options right now.

  • S.o.s. how to set a memory usage limit in flash cs4?

    flash is using 1 200 000 k. and i cant work in this situation. i know that i can limit the usage of memory in ps cs4. but i dont know how i do it in flash. is there a way of limiting the memory usage or making flash use memory as much as this?

    Thats all my poblems!!!
    I used File Monitors from Sysinternals and I see, that Flash operated with C:\xalan\xercesImpl.jar (on my system), and can't find C:\Program Files\Adobe\Adobe Flash CS4\META-INF\services\org.apache.xerces.xni.parser.XMLParserConfiguration  and others...
    I temporary remove xalan - well - thats all - CS4 successfully compile, test, check codes !!!
    1) Adobe CS4 used Xerces Apache (and configurated himself, without us)
    2) Use Sysinternals to detect other file-problems
    On my machine Flash 8, CS3, CS4 - for adjusting project compatibility.
    ==========
    PS.  Читает то, что попалось первым
    ENVIRONMENT > CLASSPATH:
    .;C:\xalan\xalan.jar;C:\xalan\serializer.jar;C:\CODE\xalan-j\xml-apis.jar;C:\xalan\xercesI mpl.jar;%CLASSPATH%;C:\Program Files\Java\jre6\lib\ext\QTJava.zip
    Ну нравится Макромедиа-Адоб Флэш...

  • How to minimize Firefox memory usage

    I've been using mozilla software for a very long time, but lately memory usage in firefox has been getting far too out of hand. I used to be able to have hundreds of pages open without using too much memory, but for some time now I have only been able to have a fraction of the number of pages open before hitting the same levels of memory use. A new firefox session I opened today hit 600 megabytes of memory after loading 7 pages. Earlier today, firefox was collectively using over 20 *gigabytes* of memory. This is all for firefox itself, which is set up without any extra plugins beyond the basic ones for flash, java, and audio/video. Sometimes I've gone to using elinks for some of my "main" browsing just to avoid the extra memory bloat, but I would much rather use a more complete browser when I don't need to browse through a ssh tunnel.
    When I purchased 16 gigabytes of memory for my computer, I did not expect all of it plus some to be used just by my internet browser, so I need to know how to cut firefox's memory usage as much as possible. I care next to nothing about caching, especially since I already have a caching proxy anyway (squid 3). I just need firefox to not end up leading me to a newegg page for an additional 16 gigabytes of memory. What can I do to alleviate this issue?

    Hi,
    These two links might help
    *https://support.mozilla.org/en-US/kb/firefox-uses-too-much-memory-ram
    *https://support.mozilla.org/en-US/kb/firefox-uses-too-many-cpu-resources-how-fix
    Firefox has hardware acceleration set to "on" by default, but it's still young, which means some video cards or drivers might have problems with it. You can try to disable hardware acceleration to see if that alleviates your problems.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps for Firefox version 29.0 and above:
    *Click the menu button [[Image:New Fx Menu]] and select {menu Options} for Windows or {menu Preferences} on Mac or Linux. For Firefox 28.0 and previous versions, click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window, click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]

  • What's the maximum memory ram for Macbook Pro?

    Hello,
    May I know what's the maximum memory ram capacity for Macbook Pro?
    I am having Macbook Pro - 2.53GHz Intel Core 2 Duo
    Thank you!
    Alvin

    Hate to resurrect a dead horse but....I was looking in the instructions for memory upgrades and the instructions specified that the computer will only recognize 3 gigs. Will that still be in effect if I upgrade to Snow Leopard when it becomes available? Or do I need to save my pennies for a Mac Pro? What I am getting at is: is the reason for the RAM cap due to software issues, 64 bit not being native, different version of leopard used on notebooks, or is it due to hardware issues.

  • How to fix the memory usage of Ely`s FlexBook is insanely increasing when turn page that contains large images?

    Hi,
         I am using flexbook for newspaper project. We have lots of huge size images in our app,all more than 1 MB. I use SuperImage as flexbook content,I also noticed that the application was using huge amounts of memory and crashed IE6, IE7,IE8 and Firefox. I found that flexbook updateDisplayList method call many times and each time flexbookpage call copyInto method when turg page,this cause memory growing. And memory not released when call commitProperties method.
    I would really appriciate any help because I have no clue how to fix it.(我的英语不好,但是我真的很着急。)
    See my partial code below how I am using the flexbook.
         //从后台Java代码得到报纸页面集合
         var list_pages: ArrayCollection = event.result as ArrayCollection;
         pageList = list_pages.toArray();
         //显示右侧报纸版面列表
         getPageListDisp();
         //画布擦除所有子元素
         can.removeAllChildren();
         //创建FlexBook
         var book:FlexBook =new FlexBook();
         book.height=0.9*h;
         book.width=0.8*w;
        //FlexBook需要配置的属性
         book.itemSize="halfPage";
         book.animateCurrentPageIndex=false;
         book.animatePagesOnTurn=false;
         book.setStyle("edgeAndCornerSize",120);//翻动的页脚大小
         book.setStyle("activeGrabArea",1);//把翻动的范围设置为页边
         book.scaleX=sldrb.value;//设置book的放大比例
         book.scaleY=sldrb.value;
        var con:Array = book.content;//为book添加报纸版面
        con.push(new Image());
         for(var i:int=0;i<pageList.length;i++){
         var img:Image=new Image();
         img.source=pageList[i].pageBigImgUrl;
         img.maintainAspectRatio=true;
         con.push(img);
        book.content = con;
         can.addChild(book);
    <mx:Panel id="test1" width="80%" height="100%" horizontalScrollPolicy="off" verticalScrollPolicy="off" paddingTop="15" paddingBottom="15">
        <mx:Canvas id="can" scaleX="{sldrb.value}" scaleY="{sldrb.value}" click="MouseEventFunc(event)" borderColor="#8EC7EF" backgroundColor="#FFFFFF" horizontalScrollPolicy="off" verticalScrollPolicy="off" alpha="1.0" buttonMode="true" mouseDown="MouseEventFunc(event)" mouseUp="MouseEventFunc(event)">
          </mx:Canvas>
       </mx:Panel>

    Or you could include a width to your body style:
    body {
    background-image: url(Logo/sky1.jpg);
    background-position: center center;
    background-attachment: fixed;
    width: 75%;}
    It might work or not depending on your other color scheme.

  • How do I use memory stick for pictures

    How do I use a memory stick for my pictures?  I put it in the side of computer?  I want to look at
    my pictures on it and save more on it?

    Open Finder, the stick will be in the left hand pane, click on it and what is on the stick will show up in the right hand pane. Double click on one of them and it should open in Preview or iPhoto.
    You can use iPhoto for this also and you can copy images from iPhoto onto the stick.
    I dont use iPhoto, I use Lightroom, and when I do something like this I use Finder.

Maybe you are looking for