Peformance Improvement by increasing heap size

Hi
Is there any performace benefit when I execute my Java application by increasing the default heap size using Java -ms200m -mx200m <appName>
Please support with some performance figures
Regards
Vishal

If you know the size of the heap gows to you can save some time on startup. i.e.
If you know it grows to 100 MB on startup, make this the initial size.
The only diference I have found is when using SoftReference caching. Having more heap size will allow such a cahce keep it data for longer.
I would suggest running the application with -verbosegc to soo how often it garbage collects and how long it spends do it.
If you want to improve performance use a profiles e.g. JProfiler, Optimize-It, JProbe

Similar Messages

  • Problem increasing heap size using Java Control Panel

    I am running a web-based bioinformatics package which uses a Java applet as the client application. It mostly works fine, but some large clustering processes don't complete, they just cycle endlessly. The user manual advises increasing heap space "by entering the following command in the Java Control Panel or Java Plug-in dialog: -Xms128M -Xmx256M." I can open the Java Control Panel OK and enter the necessary command in the Java Runtime Parameters box, but after clicking OK then Apply, the Runtime Parameters box is empty again and there is no increase in the heap size allocation. In other words, the change doesn't take effect.
    I have already tried: adjusting one parameter at a time (max heap size first, then min); changing uppercase to lowercase M (-Xmx256m); restarting the browser after the change; rebooting my PC - none of these has helped.
    Technical details: it's Java 6 standard edition, build 1.6.0_10-rc-b28; browser is Internet Explorer 7; operating system is Vista (Service Pack 1); PC is a 2.4 GHz processor with 2 GB RAM (so I have plenty available to allocate to Java). I have local admin privilege on my PC.
    Help would be much appreciated, as I really need to complete these cluster analyses. I'm a biologist not a developer, so ideally I need a solution that doesn't involve major programming, though I'm OK with registry edits and use of the command line. Thanks in advance.

    The failure to retain the parameters is a bug, per hdong in this [Java,net thread|http://forums.java.net/jive/thread.jspa?threadID=44540&tstart=0] dated August 14
    "I did a little more research and found out that the problem is only with "-rc" or "-beta" versions of plugin. When 1.6.0_10 is finally released, the version string will be "1.6.0_10". Plugin works fine to set/get jvm parameters when version string is "1.6.0_10".
    I am surprised that this issue was not discovered earlier. It was probably because the internal test binary use "1.6.0_10" as version string.
    Yeah, it is a bug that will affect many manny developers. It will be fixed as soon as possible."

  • Increasing heap size

    Hi,
    I am working on a java program that do parsing of large XML files in the order of 40 - 50 MB and put it in database. when i execute the program it is taking a lot of time to get completed(around 10 hrs)
    I tried to increase the heap size, but could not find a corect heap size for my system.
    Will the problem be solved if i increase the heap size? if so is there any guidelines for setting the heap size?
    Thanks,
    Prasanna

    Are you using the DOM or the SAX parser? For very large files you should always use the latter, then the odds are heap storeage won't be an issue.
    Also, as yawmark says, think about database transactions. You should probably do a commit after every few records are inserted, otherwise the rollback buffer in the database engine can get huge. It could be the bottleneck isn't in the java program at all.

  • How to increase heap size in java code, not using "java -Xms64m "

    Im writing a java programme for loading the german dictionary. my dictionary is very huge(around 300000+ words).
    while loading the dictioanry im getting error "OutOfMemoryError" .
    I found one solution to increase the heap size, but i want to increase the heap size in java programmer itself, not outside jar file. so i could not use "-Xms64m" option of jvm.
    Can anyone tell me how can i do this

    sunlover1984 wrote:
    Im writing a java programme for loading the german dictionary. my dictionary is very huge(around 300000+ words).
    while loading the dictioanry im getting error "OutOfMemoryError" .
    I found one solution to increase the heap size, but i want to increase the heap size in java programmer itself, not outside jar file. so i could not use "-Xms64m" option of jvm.
    Can anyone tell me how can i do thisThat option is a startup option for the JVM. That means if your jar is already loaded then you are already too late to try and call it.

  • How to increase heap size in OC4J .

    Hi Friends ,
    I am getting out of memory exception,so i need to increase the heap size , so kindly provide me the information where and how could I increase the heap size in OC4J ?.
    Yrs
    Jeyaprakash

    you should be able to pass the java heap options when starting the container:
    -Xmx1024M
    So if you are starting the 10.1.3 container from a Windoz command file you could use:
    setlocal
    @echo off
    set ORACLE_HOME=C:/Programs/oc4j-10.1.3
    set JAVA_HOME=C:/Progra~1/Java/jdk1.5.0_07
    set J2EE_HOME=%ORACLE_HOME%/j2ee/home
    %JAVA_HOME%/bin/java.exe -Xmx1024M -jar %J2EE_HOME%oc4j.jar

  • How To Increase heap size in Java Studio Creator 2

    Hi,
    I'd like to know how I can increase the heap size in Java Studio Creator 2.
    I already tried editing creator.conf, but it doesn't seem to work...
    Can anybody help me?
    thanks.

    In the servers window of creator, right-click 'Deployment Server' and choose 'View Admin Console'. A new web page comes up with the web interface to the Sun Application Server 8. Type your username and password that you configured during installation. I think default username is admin and default password either admin or adminadmin. After you're in, click 'Application Server' link in the left window, then click 'JVM Settings' tab, then click 'JVM Options' tab. Add new JVM option -Xms512m to start the server with 512MB. Find the -Xmx option and edit it to something larger, provided you have enough memory on your system.

  • How to increase Heap size at runtime

    Hi,
    In my application i sometime require to parse large XML files,so for doing that i require to increase the heap size dynamically.Is there any way to do that ?
    Thanks in advance
    Gurpreet Singh

    And unless there is no reason to be swapped out
    (plenty of physical memory) then it will be swapped
    out.I don't understand this. If there is no reason to
    swap a page back to the disk - e.g., there is plenty
    of available phyiscal memory for some other process -
    then why would the OS bother to swap that page back
    out to the disk?Ok I don't understand the statement either :)
    So obviously I need to rephrase it.
    Page swapping only occurs when needed. If there is plenty of physical memory to hold everything, then swapping does not occur.
    On the other hand if there is not enough physical memory then pages will be swapped out.
    >
    And application can also tell the OS that it nolonger
    wants to use some memory (pages.) But what doesthis
    gain the application? After all if it kept thememory
    and simply did not use it, it would not affectother
    applications. That is because the memory isswapped
    out to the harddrive until needed. So there is no
    need for an application to return memory to the OS.But since virtual memory is finite and there is a
    performance overhead if there is frequent swapping of
    pages into physical memory and out from the disk
    (thrashing), overall performance/throughput degrades.Some what correct. First virtual memory has a finite limit. But that limit itself does not affect other applications.
    Virtual memory in of it self does not cause swapping. If I allocate 1 gig for my application, when my application runs it will not have 1 gig of physical space. Only the memory that is 'touched' is relevant to the OS. So during a time slice it might be the case that only 16k of actual physical memory is used - say 8k for the small piece of code running and 8k for data (an over simplification but appropriate for this discussion.)
    It is rather unlikely, perhaps even impossible, that the entire 1 gig of memory would be swapped into memory during a single time slice.
    If the process' consumption of memory can not be
    streamlined, then that's typically when people go and
    buy more physical memory, no? Or in some cases,
    increasing the amount of virtual memory available to
    the OS can alleviate the problem.There is a difference between requesting memory and using memory. Memory that is used ('touched') is the only thing that has to be in physical memory. If you do indeed use a lot of memory in your application then more physical memory will help. But simply requesting more memory doesn't impact physical memory.

  • Increasing heap size of JVM

    how to increasing Java virtual machine ? Heap size
    can any one write me a program of tell me some idea.

    Sun's API+documentation is also a good place to start:
    http://java.sun.com/javase/6/docs/
    From there you get to the manual page for java.exe:
    http://java.sun.com/javase/6/docs/technotes/tools/windows/java.html
    Read the entries of -Xms and -Xmx. For examble:
    java -Xms256m -Xmx512m MyClassThis starts the memory allocation pool with 256 megabytes and gives it
    a maximum of 512 megabytes. If the numbers are two big for the JVM to
    handle, it will fail immediately with a message to that effect.

  • JGrasp -- how to increase heap size?

    Hello, can anybody tell me how to increase the max heap size in jGrasp?
    Thank you.

    Thanks.. I tried that, but I'm not sure that it
    increased the heap size. I tried using that method
    to set it to 512MB (-J-Xmx512m), and when I open up
    System Properties within jGrasp, it says:
    Free Heap: 7,805,040
    Total Heap: 19,812,352
    Max Memory: 532,742,144That is what you would expect with a 512MB max heap.
    And then I put the following lines of code in my
    program:
         long max = Runtime.getRuntime().maxMemory();
    System.out.println("Runtime.maxMemory():
    ): "+max/1024/1024+" MB");
    And the output that I got was: "Runtime.maxMemory():
    63 MB"You have set the max heap for jGRASP itself, which you
    might need if you are editing some huge files or
    something and jGRASP is running out of heap. Max
    heap for user programs is a different issue. To change
    that, on the compiler settings for the current workspace
    or project, in the "Flags/Args/Main" tab, add Java flags
    like "-Xmx512m" to "Flags2 or Args2" for the "Run" and
    "Debug" rows.

  • Increase heap size of ucm server

    Hi
    How do i increase the heap size of UCM managed server?

    Hi ,
    If you are starting the server from command line then you can pass the -Xms <value>m -Xmx <value>m along with startManagedWebLogic UCM_server1 .
    Or to set it for node manager to pick up if that is the mechanism used to start servers :
    Sending the Startup Memory Arguments when you have NodeManager configured. When you have your Managed Server instances configured to be controlled by Node Manager, the memory arguments can be passed as startup parameters from the Admin Console.
    From the Admin Console, select the server instance you want to start: <ManagedServerName> -> Configuration -> Server Start -> Arguments
    In the 'Server Start' page for the managed server in the admin console, add the memory values-Xms<value>m -Xmx<value>munder the arguments tab.
    Another way is to edit StartManagedWebLogic script and edit the following:
    After the JAVA_OPTIONS = "... {JAVA_OPTIONS}" line type:
    JAVA_OPTIONS="${JAVA_OPTIONS} -Xms<value>m -Xmx<value>m"
    Thanks,
    Srinath
    Edited by: Srinath Menon on May 29, 2013 5:58 PM

  • How to increase heap size in Java in detail?

    I am writing an java app in eclipse that do need a lot of memory.
    The default
    java -Xms32m -Xmx128mis not enough.
    I want to change it to
    java -Xms128m -Xmx512mI opened the command line in windows xp and changed the current directory to the installing place of jre and jdk.
    But under either directory after I ran the above command, it returns help information like
    C:\Program Files\Java\jdk1.6.0_05\bin>java -Xms128m -Xmx512m
    Usage: java [-options] class [args...]
               (to execute a class)
       or  java [-options] -jar jarfile [args...]
               (to execute a jar file)
    where options include:
        -client       to select the "client" VM
        -server       to select the "server" VM
        .......Have I changed the heap size successfully?
    How can I verify it? I am using eclipse 3.2 running the application.
    Please offer me some help. Many thanks!
    Edited by: aaron9979215 on Jul 6, 2008 8:56 PM

    It is showing you the help message, because you forgot to specify a class. When you call the "java" command, you have to say a class name after the -Xms and -Xmx commands.
    So, do this:
    java -Xms128m -Xmx512m classNameWhere className is the main class of your app.
    Best of luck.
    -ottobonn-

  • How to increase heap size in JVM??

    Hello all,
    Iam trying to deploy an EAR file from JBuilder6 to WebLogic6.1 and Iam running into java.lang.OutOfMemoryError in JBuilder!!..Can someone tell me how to overcome this problem.
    TIA

    there are a set of config files in the JBuilder directory (bin directory I think - removed JBuilder a while back) that specify JVM arguments, what JVM to run etc.
    Chuck

  • How to Increase Java Heap Size through Java Code. Increase inside Code?

    Hi All,
    I am using a third party tool. When i run a particular program it says OutOfMemory error. I like to increase heap size through Java Code before calling the particular Java application or Code..
    Is there is any way to set the Heap Size through Java Code in run time ???
    Pls Kindly help.
    Thanks.

    if you start the program with a -Xmx512m flag, the virtual machine gets half a gigabyte of memory to use (or that's the max it's allowed to use). All things run in the same virtual machine will have the same limit, third party tools run in the same virtual machine can't "not care about this" unless they're throwing OOMs themselves for some stupid reason.

  • How to set the Heap size for JAVA

    I am facing the memory out of space problem:
    Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
    Could anyone suggest me a solution to solve the problem ?
    increase the heap size ?
    anyway to increase the heap size in the program by default without additional setup?
    Thank you.

    How to determine the program must handled with increase heap size ?
    could I know any method to know whether the program is memory leaking or need large memory heap size?

  • How to set the heap size in adminstrative console

    Hi All,
    Please let me know how to increase heap size in weblogic Adminstrative console.
    Regards
    Madhu

    The answer to this depends on whether you're trying to set the heap size for a manager server which is managed by NodeManager, or the admin server.
    First click on "Lock and Edit".
    If the former, go into "Environment"->"Servers", then click on the server you want to configure. This should start you on the "Configuration"->"General" tab. Now click on the "Server Start" tab. Find the "Arguments" field. Assuming this is blank, put something like the following in the field value:
    -Xmx1536m
    Then click "Save", then "Activate Changes". When you restart the managed server the next time, it should use those new settings.
    If, however, you're trying to set this on the admin server, you can't do this in the admin console at all. In that case, go into $DOMAIN_HOME/bin and edit the "setDomainEnv.{sh,cmd}" script (".sh" if on Unix/Linux, ".cmd" on Windows). Find the line that sets the "MEM_ARGS" variable, like the following on Windows:
    set MEM_ARGS=-Xms256m -Xmx512m
    Change this line to whatever you want, then restart the admin server.

Maybe you are looking for

  • I got a new macbook. How can I transfer my old songs on my iphone onto the new itunes

    I dont want my music deleted but I do want my new songs on my iphone. How can i do that?

  • Apple TV and External HDD

    I'm running out of space for the movies on my internal HDD. I purchased an 40G ATV (the 160 was out of stock) and I intended to store the movies there. Since 40G is too low, I wanted to connect an external HDD to the ATV. Is this possible and if yes,

  • BID approval workflow -single approver

    Hello  Masa, This is in continuation with my earlier post on other thread """""" Hello Masa, Sorry to hijack this thread but since my problem is of same nature (and may be simpler) Hence I thought I would make use of the same. I am activating Bid Inv

  • Dynamic select list as APEX plug-in custom attribute?

    I'm developing a region plug-in in APEX 4.0.1. I wanted to make one of the custom attributes a select list where the options offered were the current application list templates (queried from the <tt>apex_application_temp_list</tt> view: the rendered

  • Command+V = Failed to load extension?

    Ok so here's what I get after command+V: Failed to load extension com.apple.driver.applemacriscAGP Failed to load extension com.apple.driver.applemacriscPCI Couldn't alloc class AGP Then it keeps repeating: Still waiting for root device Does anyone k