Does the jvm allocate complete max heap size initially?

Does the JVM allocate the memory for the entire max heap size up front, or does it start with the specified minimum size and increase and grab more later if needed?
The reason this is being posted is because we have a number of jboss servers that are being run. Some don't require large heap sizes, others do. If we use the same large max heap size for all would all the memory get allocated up front, or possibly a smaller initialization portion?

I have done the test with Solaris, Linux and WinXP.
Test with -Xms512M
Have written a simple java program to which the minimum heap size was set to -Xms512m then the program was executed on Solaris and WinXP platforms. The usage of memory of the Java process was 6 MB in WinXP and 9 MB in Solaris, rather than 512 MB. The JVM is not allocating the configured minimum size of 512 MB at the start of the process execution.
Reason:
If you ask the OS for 512 MB it'll say "here it is", but pages won't actually be allocated until your app actually touches them.
If the allocation is not being made initially during the start of the process, the concept of minimum heap size is not required.
But the garbage collection log shows the minimum heap size as what was configured using -Xms option.
Test with -Xms1024M
The JVM arguments was set to : -Xms1024m -Xmx1024m, but the used memory observed using Windows perfmon was 573M.
6.524: [Full GC 6.524: [Tenured: 3081K->10565K(967936K), 0.1949291 secs] 52479K->10565K(1040512K), [Perm : 12287K->12287K(12288K)], 0.1950893 secs] Reason:
Optimization is something that the operating systems do. The JVM allocates the memory in it's address space and initializes all data structures to your -Xms. In any way that the JVM can measure, the allocation from the OS is complete. But the OS doesn't physically assign a page to the app until the first store instruction. Almost all modern OSs do this.
Hope this is helpful.

Similar Messages

  • Siginficance of max heap size mentioned in configtool

    Hi all,
    could anyone please tell me the exact significance of
    max heap size mentioned in configtool in SAP Netweaver in
    <b>1)Instance_ID</b>
    -servers general
    -message servers and bootstrap
    <b>2)Dispatcher_ID</b>
    -general
    -bootstrap
    <b>3)Server_ID</b>
    -general
    -bootstrap
    Which of these do i change to improve the performance?
    I tried changing the max heap size specified in
    <b>Server_ID</b>
    -general
    but i got the following error while trying to start the server  in std_server0.out:
    node name   : server0
    pid         : 3452
    system name : N02
    system nr.  : 01
    started at  : Tue Mar 20 21:53:37 2007
    Reserved 1610612736 (0x60000000) bytes before loading DLLs.
    [Thr 1912] MtxInit: -2 0 0
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Regards,
    Namrata.

    Hi,
    The biggest impact to runtime performance will be adjusting the heap size of the server JVM. This is done in Server_ID->general.  The JVM parameters entered here take precedence over parameters in Instance_ID->servers general.  The server job by far do the most work in the Java engine and so it is very important that the JVM for the server node is tuned to handle the workload.  Tuning the server JVM or even adding additional server nodes is dependent on the workload and the amount of work on the system.
    Adjusting the heap for the other JVMs will have much less of an impact than adjusting the heap in the server JVM.
    The dispatcher JVM heap settings may have a slight impact during runtime, but compared to the server jobs the dispatcher does relatively little work.  Depending on your situation you may need to tune the dispatcher a little, but my experience has been that the default value for the dispatcher is usually sufficient.
    The values for all of the bootstrap jobs may have an impact on startup time, but they will have no impact on runtime since these jobs go away once the system is up.  From what I have seen the defaults values for the bootstrap jobs are sufficent.
    I never adjust anything under Instance_ID, I'm not sure what these parameters are used for except for maybe default values when adding server nodes.  Maybe someone out there knows.
    Hope this helps.
    Regards,
    Kolby

  • "Could not create the Java virtual machine." when max-heap-size is 926Mb

    We received "Could not create the Java virtual machine." when the max-heap-size provided exceeded 926 Mb in XP PC. We found the below mentioned link which confirms that this is a bug
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6945136
    But the problem is that the issue does not get recreated in all the XP PCs. Increasing the max heap size to greater than 926 works fine in some XP PCs.
    Could there be any configuration related issues for this problem...

    If you can't find any difference in your java versions or overall runtime configurations, it's quite possible that the bug doesn't have the complete picture--it might be more subtle than the conditions described. Maybe it works with certain versions of certain lower level DLLs. Maybe it has some dependency on which services are running. Maybe the order in which certain components got installed put one version of something vs. another further ahead in a CLASSPATH, LD_LIBRARY_PATH, etc. variable.
    Or maybe it's as simple as you're not running the version of Java you think you are on all those boxes, as jschell suggests.
    Regardless of the reason why it happens to work on some configurations, you found that it fails on some, and that failure is in fact a known bug. So it shouldn't surprise you that it fails at least sometimes, and the fact that it works sometimes has been rendered irrelevant. Unless you're doing research into the specific cause of this issue.

  • How to set  max-heap-size outside the jnlp file?

    Due to bug_id=6631056 It may not be possible to specify max-heap-size within
    the JNLP file for certain jnlp java applications.
    Are there other possibilities to specify this Jvm parameter?
    In the ControlPanel there is the possibility to specify Xmx for applets but not for jnlp.
    I have tried to add properties like
    "deployment.javaws.jre.0.args=Xmx\=128M" without success
    Many thanks

    Even in JNLP also you can specify the max heap size
    <j2se version="1.5+" initial-heap-size="128m" max-heap-size="512m"/>
    Thanks,
    Suresh
    [http://sureshdevi.co.in|http://sureshdevi.co.in]

  • How do define the limit of the max heap size?

    Hi All,
    I would like to know what should be the limit of the JVM max heap size.
    What will happen if we will not define it?
    What is the purpose of defining it from the technical point of view?
    Thanks
    Edited by: Anna78 on Jul 31, 2008 12:36 PM

    Defining a max heap space too large can have the following effect:
    If you create new objects, the VM may decide it is not worth getting rid of garbage-collectable ones, as there
    is still plenty of space between the current heap size and the max allowed. The result will be that the
    application will run faster and will consume more memory than it really needs.
    If the heap size is too small, but still sufficient, the application will do a lot of garbage-collection and therefore
    run slower. On the other hand, it will stay inside the tight space it has been allowed to use.
    The speed difference may or may not be noticeable, while the difference between 256M and 512M may
    or may not matter on today's computers.

  • Max heap size limits

    I've been looking around for information on the max heap size limits on Sun's JVMs but can't seem to find any information. Just by testing, it seems like the max heap size for Windows 2000 can vary from 1.3G to 1.6G depending upon the machine (JDK 1.4). Does anybody know where I could find actual documentation that describes the limits for Sun's VMs on Windows (2000 and Advanced Server), Linux, and Solaris? I'm about to file this as a documentation bug against the JDK.
    God bless,
    -Toby Reyelts

    There was an older thread in the forums that had some info on this - my quick search failed to locate it, ypu might want to spend some time looking. The basic problem is memory space fragmentation by the OS, where the OS locates items in memory and effectively constrains heap growth to the unfragmented area that the heap starts in.While there may be more "unused" memory, it's not contiguous. There is also some info in MS's MSDN data regarding this condition, with information on the various OS's. I think Linux has a similar "condition".

  • Increase Java Max Heap Size

    Hello ,
    How can I increase java max heap size to more than 2G .I tried a bunch of different sizes and anything under 2G works just fine so this appears to be a hard limit.
    system info:
    Linux server with process data model 32-bit ,Java 1.5 , total physical memory 9GB and available virtual and physical memory close to 4GB
    I would appreciate any guidance on how to resolve this.
    Regards,
    Omid

    warnerja wrote:
    Any application wanting to allocate that much of a heap size should be considered a rogue application and a system hog of gigantic proportions, not desirable to have running on anyones machine. Focus on designing it correctly so that it doesn't require so much memory in the first place.By very virtue of the fact that the author has a test box with 9 gigs of RAM (I'm inferring), it seems unlikely that this app will be distributed to just "anyone."
    However, if this is meant to be some server app that scales to an enormous memory capacity, you're probably better off not using the java launcher directly and instead using some enterprise container.
    I'm a complete newb when it comes to anything meant to be scalable though, so warnerja would probably have better advice than I would.

  • Setting System-Wide Max Heap Size

    We want to set the heap-size of Java-Plugin 1.5.0_14 for a company-wide rollout to a fixed size under Windows XP.
    In deployment.config under C:\Winnt\Sun\Java\deployment I am giving this:
    deployment.system.config=file:C:\\WINNT\\Sun\\Java\\Deployment\\deployment.properties
    deployment.system.config.mandatory=true
    In the respective deployment.properties I am giving
    #deployment.properties
    deployment.cache.max.size=50m
    deployment.javapi.jre.1.5.0_14.args=-Xmx256m -Xms75m
    While the cache-parameter is taking effect (visible in the Java Control Panel) there is no change in the Max Heap Size.
    Any idea how this could be achieved?
    Thank you
    Michael

    MaxHeapSize I determine with Runtime.getRuntime().maxMemory()
    Setting it manually in the javacpl via -Xmx works fine but....
    Problem is that we do not want each user to open his Java Control Panel and set this value manually.
    May be error prone and difficult to communicate in a scenario where you have hundreds of users in different locations, countries etc.
    Should be possible to set this value once installing the Java Plugin
    Thank You
    Michael

  • Strange: Mac screen menu-bar requires max-heap-size to be set.

    I planned to omit the max-heap-size attribute in the line of my jnlp file
    <j2se version="1.6+" max-heap-size="256m" />
    The idea was that with Java 1.6 the heap size is set automatically
    according to the client's RAM.
    Unfortunately, the Macintosh screen menu-bar works if and only if the max-heap-size attribute is present.
    It is a MacOsX=1.4 with Java1.5.
    Strange, since the Mac runs Java 1.5 and I am talking about settings for 1.6.
    The jnlp passed ValidateJNLP at http://mindprod.com/jgloss/jnlp.html#VALIDATION
    Here is another post stating that attributes in JNLP have side effects on Mac's screen menu-bar:
    http://lists.apple.com/archives/Java-dev/2008/Jul/msg00122.html
    Here is my jnlp:
    w3m -dump http://www.bioinformatics.org/strap/strap.jnlp
    Is there an explanation for this?
    Christoph

    user10289576 wrote:
    I would not blame Macintosh.
    The error might still be in the Sun's code.Could be. But to fix the Mac VM it would require the following.
    1. Find it in the Sun VM.
    2. Fix it in the Sun VM.
    3. Move the changes to the Mac VM...somehow.
    >
    If the jdk would be smaller, less redundant and clearer, then
    open JDK could be possibly compiled on a Mac.
    Not sure what that means since there are likely OS level calls that must be implemented in some place in the API. Which are specific to Mac.
    Just as there are differences between windows/solaris/linux which Sun accounted for.
    And that would be what Apple would have done to make it work on Mac. And what someone (someone who likes Mac) will need to continue to do with the public release (explusion?) which is the form that Java will have going forward.
    The main thing that should be improved on a Macintosh
    is to directly allow for Linux and Solaris executables such that the Linux JDK could directly work on a Mac.The main thing, again, is the Apple is no longer supporting Java on the Mac.
    And Apple, not Sun and certainly not Oracle, were the ones that created the Java VM.
    So the main thing at this point is that ALL future directions that Java take are dependent not on Apple but on the Macintosh community. That includes features as well as fixes.

  • Max Heap size of j2ee web dispatcher ??

    Hello All,
                  Max Heap size of j2ee web dispatcher for our DEV BI 7.0 is 1024 MB.But our QA BI 7.0 system is 130 MB.I need to know in which sceanario we increase Max Heap size of j2ee web dispatcher??For BI 7.0 what should be the perfect heap size??

    Dear's about what you speaking, may be i do not know anything ?
    Max Heap size of j2ee web dispatcher for our DEV BI 7.0 is 1024 MB.But our QA BI 7.0 system is 130 MB.
    What are web dispatcher? it's about it -->
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/c6/0c2c79b9fc4e1c8548815bf56300f4/frameset.htm
    Where are her heap? If you say aboy dispatcher nodes in AS JAVA, when it is  not "web dispatcher" 
    Manoj Chintawar   wrote :
    You should be ok to set max heap size to 1024 MB since you have 16GB of RAM in your system.
    where you read abot it ? Per same Note 723909 - Java VM settings for J2EE 6.40/7.0 -->
    For dispatcher nodes it's sufficient to set the heap size to 171m on 32 bit and to 256m on 64 bit platforms. There is no need to apply the parameters mentioned under 4-9 below.
    Regards.

  • Update after max heap size change in jnlp file

    Hi,
    we added max-heap-size="256M" to an already via Web Start deployed application (meaning all required clients are using the application already). This attribute was the only change to the jnlp file, the application (the jar file) didn't change as well. Do clients notice this change and resize their max heap size? If not, would an application update (a new jar file) change that and the clients would update their heap size settings? Or is their any other way without uninstalling and installing the application again to notify the clients about this change?
    Thanks a lot! dos

    yes - a modified jnlp file (assuming the jnlp element has an href) will be downloaded the next time each of the clients use the application.
    /Andy
    If there is no href to the jnlp element in the jnlp file, the change will only be picked up by people who launch the app from a link on the web (as opposed to a shortcut)
    /Andy

  • Applet 1.6 max heap size regression??

    Is it true that a 1.6.0_1 applet forces 64M max heap size?
    It certainly is the case on my Vista PC running 1.6.0_1 which as 2gig of physical memory.
    On another PC running XP sp2 java 1.5.0_11 I am seeing that the max heaps size follows the max heap size = 1/4 max memory as I'd expect.
    Is there a regression in 1.6 in this regard?
    Thank you!

    Is it true that a 1.6.0_1 applet forces 64M max heap
    size? Not on my 1 gb XP Pro. This info is from the Java Console.
    java.vm.vendor = Sun Microsystems Inc.
    java.vm.version = 1.6.0_01-b06
    javaplugin.maxHeapSize = 96m
    It certainly is the case on my Vista PC running
    1.6.0_1 which as 2gig of physical memory.
    On another PC running XP sp2 java 1.5.0_11 I am
    seeing that the max heaps size follows the max heap
    size = 1/4 max memory as I'd expect.
    Is there a regression in 1.6 in this regard?The max heap for applets running in a browser isn't controlled by Java; the heap space is shared with the browser and other plugins, and probably also varies by browser. If you give the Java plugin too much heap, other things can fail due to memory starvation.
    >
    Thank you!

  • We are looking for a software which converts SWF to MP4, we found many software which does the job but issue is file size is not optimize.  We found Adobe captivate 6 which gives optimum quality with good output but thing is we do not have batch process i

    Hi
    We are looking for a software which converts SWF to MP4, we found many software which does the job but issue is file size is not optimize.
      We found Adobe captivate 6 which gives optimum quality with good output but thing is we do not have batch process in captivate 6. so we request you to create a plugin or give a best option which have batch render quality and optimize in file size,

    Captivate is e-learning development software not a dedicated video convertor, you are better off trying something like Adobe Media Encoder or Super.

  • In which language does the jvm program is written?

    In which language does the jvm program is written?
    Please give the reason for that
    Thanks,
    Vidyadhar

    Dear Nisha,
    you can use table GRACREVREJUSER with the correpsonding reasons from table GRACREJREASON and GRACREJREASONT.
    Regards,
    Alessandro

  • When does the JVM exit and deleteOnExit();?

    I developed a JSP that queries a database, displays the results in a browser, and writes the results to the server as a file. While the user is viewing the JSP, they can click on a download link to save the file that was written to the server. Everything works fine!
    I would like to delete the file that was written to the server (to save space), however, I can't delete the file until the user is finished viewing the JSP. I need some help concerning this method: java.io.File.deleteOnExit() the API states:
    "Requests that the file or directory denoted by this abstract pathname be deleted when the virtual machine terminates. Deletion will be attempted only for normal termination of the virtual machine, as defined by the Java Language Specification (12.9)."
    If I use this method, When does the JVM exit? I tested it in my home environment using Tomcat and the file was deleted when I stopped Tomcat. If I run this on a web server, does the JVM ever exit? If so when?
    Thanks
    --Scott

    The JVM stays active so long as the Java based webserver (or the servlet engine if your webserver is connected to one) is up. Only when you shutdown your server will the VM terminate. (Similar to what you observed with tomcat)

Maybe you are looking for

  • Adobe Media Encoder CS5

    Hallo, ich habe ein Problem mit Media Encoder CS5. Der Start verläuft noch normal. Wenn ich ein ca. 4GB großes MPEG2-Video hinzufügen möchte, dauert das mindestens 5 Minuten. Sobald ich die Encoder-Einstellungen ändern möchte muss ich wieder mehrere

  • I have a question about SQLLDR

    Hi all, Alongwith the data in the INFILE, I want to load the name of the INFILE too in a column of the table. How can I do that... The file name is going to be different everyday... I want to have the filename in a column of the target table to make

  • Is there a way to download the attachments from the responses all at one time?  Attachments are .doc

    Is there a way to download the attachments from the responses all at one time?  Attachments were uploaded as a  .doc file

  • LiveTech service for a laptop?

    One of my favorite reads is PC Mag, and recently read on thier webite this article about this LiveTech service by Cyberdefender. http://www.pcmag.com/article2/0,2817,2372447,00.as​p LiveTech seems like a computer helper for those who aren't familiar

  • How to cut the clips in Timeline ?

    I have placed a clip into the Timeline. I have keyframed on the 2nd last frame instead of the last frame. So, I double-click the clip on the timeline & placed the playhead on the 2nd last frame on the clip (in the timeline). Then I use the blade tool