Massive memory hemorrhage; heap size to go from about 64mb, to 1.3gb usage

**[SOLVED]**
Note: I posted this on stackoverflow as well, but a solution was not found.
Here's the problem:
[1] http://i.stack.imgur.com/sqqtS.png
As you can see, the memory usage balloons out of control! I've had to add arguments to the JVM to increase the heapsize just to avoid out of memory errors while I figure out what's going on. Not good!
##Basic Application Summary (for context)
This application is (eventually) going to be used for basic on screen CV and template matching type things for automation purposes. I want to achieve as high of a frame rate as possible for watching the screen, and handle all of the processing via a series of separate consumer threads.
I quickly found out that the stock Robot class is really terrible speed wise, so I opened up the source, took out all of the duplicated effort and wasted overhead, and rebuilt it as my own class called FastRobot.
##The Class' Code:
    public class FastRobot {
         private Rectangle screenRect;
         private GraphicsDevice screen;
         private final Toolkit toolkit;
         private final Robot elRoboto;
         private final RobotPeer peer;
         private final Point gdloc;
         private final DirectColorModel screenCapCM;
         private final int[] bandmasks;
         public FastRobot() throws HeadlessException, AWTException {
              this.screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
              this.screen = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
              toolkit = Toolkit.getDefaultToolkit();
              elRoboto = new Robot();
              peer = ((ComponentFactory)toolkit).createRobot(elRoboto, screen);
              gdloc = screen.getDefaultConfiguration().getBounds().getLocation();
              this.screenRect.translate(gdloc.x, gdloc.y);
              screenCapCM = new DirectColorModel(24,
                        /* red mask */    0x00FF0000,
                        /* green mask */  0x0000FF00,
                        /* blue mask */   0x000000FF);
              bandmasks = new int[3];
              bandmasks[0] = screenCapCM.getRedMask();
              bandmasks[1] = screenCapCM.getGreenMask();
              bandmasks[2] = screenCapCM.getBlueMask();
              Toolkit.getDefaultToolkit().sync();
         public void autoResetGraphicsEnv() {
              this.screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
              this.screen = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
         public void manuallySetGraphicsEnv(Rectangle screenRect, GraphicsDevice screen) {
              this.screenRect = screenRect;
              this.screen = screen;
         public BufferedImage createBufferedScreenCapture(int pixels[]) throws HeadlessException, AWTException {
    //          BufferedImage image;
            DataBufferInt buffer;
            WritableRaster raster;
              pixels = peer.getRGBPixels(screenRect);
              buffer = new DataBufferInt(pixels, pixels.length);
              raster = Raster.createPackedRaster(buffer, screenRect.width, screenRect.height, screenRect.width, bandmasks, null);
              return new BufferedImage(screenCapCM, raster, false, null);
         public int[] createArrayScreenCapture() throws HeadlessException, AWTException {
                   return peer.getRGBPixels(screenRect);
         public WritableRaster createRasterScreenCapture(int pixels[]) throws HeadlessException, AWTException {
         //     BufferedImage image;
             DataBufferInt buffer;
             WritableRaster raster;
              pixels = peer.getRGBPixels(screenRect);
              buffer = new DataBufferInt(pixels, pixels.length);
              raster = Raster.createPackedRaster(buffer, screenRect.width, screenRect.height, screenRect.width, bandmasks, null);
         //     SunWritableRaster.makeTrackable(buffer);
              return raster;
    }In essence, all I've changed from the original is moving many of the allocations from function bodies, and set them as attributes of the class so they're not called every time. Doing this actually had a significant affect on frame rate. Even on my severely under powered laptop, it went from ~4 fps with the stock Robot class, to ~30fps with my FastRobot class.
##First Test:
When I started outofmemory errors in my main program, I set up this very simple test to keep an eye on the FastRobot. Note: this is the code which produced the heap profile above.
    public class TestFBot {
         public static void main(String[] args) {
              try {
                   FastRobot fbot = new FastRobot();
                   double startTime = System.currentTimeMillis();
                   for (int i=0; i < 1000; i++)
                        fbot.createArrayScreenCapture();
                   System.out.println("Time taken: " + (System.currentTimeMillis() - startTime)/1000.);
              } catch (AWTException e) {
                   e.printStackTrace();
    }##Examined:
It doesn't do this every time, which is really strange (and frustrating!). In fact, it rarely does it at all with the above code. However, the memory issue becomes easily reproducible if I have multiple for loops back to back.
#Test 2
    public class TestFBot {
         public static void main(String[] args) {
              try {
                   FastRobot fbot = new FastRobot();
                   double startTime = System.currentTimeMillis();
                   for (int i=0; i < 1000; i++)
                        fbot.createArrayScreenCapture();
                   System.out.println("Time taken: " + (System.currentTimeMillis() - startTime)/1000.);
                   startTime = System.currentTimeMillis();
                   for (int i=0; i < 500; i++)
                        fbot.createArrayScreenCapture();
                   System.out.println("Time taken: " + (System.currentTimeMillis() - startTime)/1000.);
                   startTime = System.currentTimeMillis();
                   for (int i=0; i < 200; i++)
                        fbot.createArrayScreenCapture();
                   System.out.println("Time taken: " + (System.currentTimeMillis() - startTime)/1000.);
                   startTime = System.currentTimeMillis();
                   for (int i=0; i < 1500; i++)
                        fbot.createArrayScreenCapture();
                   System.out.println("Time taken: " + (System.currentTimeMillis() - startTime)/1000.);
              } catch (AWTException e) {
                   e.printStackTrace();
    }##Examined
The out of control heap is now reproducible I'd say about 80% of the time. I've looked all though the profiler, and the thing of most note (I think) is that the garbage collector seemingly stops right as the fourth and final loop begins.
The output form the above code gave the following times:
Time taken: 24.282 //Loop1
Time taken: 11.294 //Loop2
Time taken: 7.1 //Loop3
Time taken: 70.739 //Loop4
Now, if you sum the first three loops, it adds up to 42.676, which suspiciously corresponds to the exact time that the garbage collector stops, and the memory spikes.
[2] http://i.stack.imgur.com/fSTOs.png
Now, this is my first rodeo with profiling, not to mention the first time I've ever even thought about garbage collection -- it was always something that just kind of worked magically in the background -- so, I'm unsure what, if anything, I've found out.
##Additional Profile Information
[3] http://i.stack.imgur.com/ENocy.png
Augusto suggested looking at the memory profile. There are 1500+ `int[]` that are listed as "unreachable, but not yet collected." These are surely the `int[]` arrays that the `peer.getRGBPixels()` creates, but for some reason they're not being destroyed. This additional info, unfortunately, only adds to my confusion, as I'm not sure why the GC wouldn't be collecting them
##Profile using small heap argument -Xmx256m:
At irreputable and Hot Licks suggestion I set the max heap size to something significantly smaller. While this does prevent it from making the 1gb jump in memory usage, it still doesn't explain why the program is ballooning to its max heap size upon entering the 4th iteration.
[4] http://i.stack.imgur.com/bR3NP.png
As you can see, the exact issue still exists, it's just been made smaller. ;) The issue with this solution is that the program, for some reason, is still eating through all of the memory it can -- there is also a marked change in fps performance from the first the iterations, which consume very little memory, and the final iteration, which consumes as much memory as it can.
The question remains why is it ballooning at all?
##Results after hitting "Force Garbage Collection" button:
At jtahlborn's suggestion, I hit the Force Garbage Collection button. It worked beautifully. It goes from 1gb of memory usage, down to the basline of 60mb or so.
[5] http://i.stack.imgur.com/x4282.png
So, this seems to be the cure. The question now is, how do I pro grammatically force the GC to do this?
##Results after adding local Peer to function's scope:
At David Waters suggestion, I modified the `createArrayCapture()` function so that it holds a local `Peer` object.
Unfortunately no change in the memory usage pattern.
[6] http://i.stack.imgur.com/Ky5vb.png
Still gets huge on the 3rd or 4th iteration.
#Memory Pool Analysis:
###ScreenShots from the different memory pools
##All pools:
[7] http://i.stack.imgur.com/nXXeo.png
##Eden Pool:
[8] http://i.stack.imgur.com/R4ZHG.png
##Old Gen:
[9] http://i.stack.imgur.com/gmfe2.png
Just about all of the memory usage seems to fall in this pool.
Note: PS Survivor Space had (apparently) 0 usage
##I'm left with several questions:
(a) does the Garbage Profiler graph mean what I think it means? Or am I confusing correlation with causation? As I said, I'm in an unknown area with these issues.
(b) If it is the garbage collector... what do I do about it..? Why is it stopping altogether, and then running at a reduced rate for the remainder of the program?
(c) How do I fix this?
Does anyone have any idea what's going on here?
[1]: http://i.stack.imgur.com/sqqtS.png
[2]: http://i.stack.imgur.com/fSTOs.png
[3]: http://i.stack.imgur.com/ENocy.png
[4]: http://i.stack.imgur.com/bR3NP.png
[5]: http://i.stack.imgur.com/x4282.png
[6]: http://i.stack.imgur.com/Ky5vb.png
[7]: http://i.stack.imgur.com/nXXeo.png
[8]: http://i.stack.imgur.com/R4ZHG.png
[9]: http://i.stack.imgur.com/gmfe2.png
Edited by: 991051 on Feb 28, 2013 11:30 AM
Edited by: 991051 on Feb 28, 2013 11:35 AM
Edited by: 991051 on Feb 28, 2013 11:36 AM
Edited by: 991051 on Mar 1, 2013 9:44 AM

SO came through.
Turns out this issue was directly related to the garbage collector. The default one, for whatever reason, would get behind on its collection at points, and thus the memory would balloon out of control, which then, once allocated, became the new normal for the GC to operate at.
Manually setting the GC to ConcurrentMarkSweep solved this issue completely. After numerous tests, I have been unable to reproduce the memory issue. The garbage collector does an excellent job of keeping on top of these minor collections.

Similar Messages

  • DPS 6.x jvm memory heap size?

    I am setting up directory proxy server 6.3 and have the java setting for memory heap size in my notes from testing last year. Is it important to set this? Is the argument as stated ok? And is 500 ok? Doubt anything has changed since last year, but want to be sure. Thanks.
    dpadm set-flags /opt/dps jvm-args="-Xmx500M -Xms500M -XX:NewRatio=1"

    crosspost

  • Memory Usage in WinTaskManger vs heap size

    hello,
    I have exactly the same problem as in the topic "Windows Task Manager vs. Heap", posted at Dec 10, 2004 5:17 AM, by jorgeHX.
    Here are the symptoms:
    1) My application starts at 20MB seen by windows task manager
    2) I use profiler to monitor the heap. Heap is always working very healthly - heap size in the profiler increases by a minimum until the gc comes around so that the used heap size drops down again.
    3) However, after doing a relatively memory-consuming operation (loop of String indexing, patterning ..etc.), the memory usage in windows task manager goes up couple of MBs but never drops down.
    4) Then I go manually free the heap (System.gc()), I can see GC is freeing heap. However, the memory in windows task manager remains no change, no matter how many times I force the garbabge collection.
    This is a bad thing - if my application keeps doing that memory-consuming operation again and again, the memory seen in the windows task manager will be growing and growing to hundreds of MBs until the windows alerts "low on virtual memory".
    I tried everything already. I set every instance = null at the end, I delete every reference but the memory just keeps increasing! WHY?????
    Anyone can help me charactorize the problem? I am so in dark!!
    Ryan-Chi

    I guess my problem can also be interpretated as
    "Why doesn't JVM return memory to OS?"
    It does, depending on the setting of the -XX:MaxHeapFreeRatio option. "Normal" operation using the default setting does not usually cause memory to be returned to the os.
    Search for this option term for explanations.

  • Mapping set heap sizes to used memory

    Hi all,
    I've got a question about the parameters used to control your java process' heap sizes: "-Xms128m -Xmx256m" etc.
    Let's say I set my min and max to 2Gb, just for a simplistic example.
    If I then look at the linux server my process is running on, I may see a top screen like so:
    PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    10647 javaprog 20   0 2180m 1.9g  18m S  1.3  3.7   1:57.02 javaWhat I'm trying to understand is what relationship - if any - there is between these arguments and the figures I see within top. One thing in particular that I'm interested in is the fact that I occasionally see a RES (or more commonly a VIRT) size higher than the maximum that I have provided to Java. Naively I would assume that therefore there isn't a relationship between the two... but I wouldn't mind someone clarifiying this for me.
    Any resources on the matter would be appreciated, and I apologise if this question is outside the realms of this particular subforum.
    Dave.

    Peter Lawrey wrote:
    user5287726 wrote:
    Peter Lawrey wrote:
    It will always reserve this much virtual memory, plus. In term of resident memory, even the minimum is not guarenteed to be used. The minimum specifies at what point it will make little effort to recycle memory. i.e. it grows to the minimum size freely, but a "Hello World" program still won't use the minimum size.No, Linux does not reserve virtual memory. Just Google "Linux memory overcommit". Out-of-the-box, every Linux distro I'm aware of will just keep returning virtual memory to processes until things fall apart and the kernel starts killing processes that are using lots of memory - like your database server, web server, or application-critical JVMs. You know - the very processes you built and deployed the machine to run. Just Google "Linux OOM killer".Thats not the behaviour I see. When I start a process which busy waits, but doesn't create any objects, the virtual memory sized used is based on the -mx option, not how much is used. Given virtual memeory is largely free, why would an OS only give virtual memory on an as needs basis.
    Busy looping process which does nothing.
    In each case the resident size is 16m
    option       virtual size
    -mx100m      368m = 100m + 268m
    -mx250m      517m = 250m + 267m
    -mx500m      769m = 500m + 269m
    -mx1g        1294m = 1024m + 270m
    -mx2g        2321m = 2048m + 273mTo me it appears that the maximum size you ask is immediately added to the virtual memory size, even if its not used (plus an overhead) i.e. the resident size is only 16m.Yes, it's only using 16m. And its virtual size may very well be what you see. But that doesn't mean the OS actually has enough RAM + swap the hold what it tells all running processes they can have.
    How much RAM + swap does your machine have? Say it's 4 GB. You can probably run 10 or 20 JVMs simultaneously with the "-mx2g" option. Imagine what happens, though, if they actually try and use that memory - that the OS said they could have, but which doesn't all exist.
    What happens?
    The OOM killer fires up and starts killing processes. Which ones? Gee, it's a "standard election procedure". Which on a server that's actually doing something tend to be the processes actually doing something, like your DBMS or web server or JVM. Or maybe it's your backups that get whacked because they're "newly started" and got promised access to memory that doesn't exist.
    Memory overcommit on a server with availability and reliability requirements more stringent than risible is indefensible.

  • Heap size memory error on WebI Reports

    Hello,
    I'm developping my own JDBC driver to report specific data in Business Objects. I've actually an universe build on this driver and a web intelligence report. When I try to request I've an heap size error due to the size of my jvm. My JBDC driver is deployed thanks to a jar file. Normally I can increase jvm size with the argument -Xmx256M in command-line.
    I tried several things :
    I modified register HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/Session Manager/Subsystems, SharedSection to 1024,3072,1024
    I passed Tomcat's memory to 1024, I can't more because I'm on 32 bits on Windows Server 2003.
    I tried to add MAX_HEAP_SIZE=1024000000 on webi.properties in c:\programfiles\Tomcat\webapps\businessobjects\enterprise115\desktoplaunch\WEB-INF\classes\, as explained on a post,but this directory doesn't exist, but there is 4 different webi.properties files one in C:\Program Files\Business Objects\Tomcat55\webapps\PerformanceManagement\WEB-INF\lib so I added max heap size parameter in this one.
    I improved my JDBC-driver to avoid memory leak, and BO requests to limit results.
    But I still have an heap size error.
    Some people have other ideas to solve my problem ?
    Best regards.       
    BO XI 3.1 Service Pack 2 HotFix 1
    Tomcat 5.5 : 1024Mo memory allocation
    Windows Server 2003 32bits

    Hi Hizam,
    1. Go to universe and click on View--> Structure
    2. Check objects and Conditions.
    3. If you found any changes then re-export your universe and run queries.
    Once everything goes fine then Schedule the report.
    Hope it helps you....!!
    Thank You!

  • How to monitor heap size used in OPP in order to protect Out of Memory

    My objective is to know how much heap size currently use so I can handle or do something before user got error report.
    The following sql statement just determine what the heap size per OPP process is currently setting:
    select DEVELOPER_PARAMETERS from FND_CP_SERVICES
    where SERVICE_ID = (select MANAGER_TYPE from FND_CONCURRENT_QUEUES
    where CONCURRENT_QUEUE_NAME = 'FNDCPOPP');
    Now OPP heap size is set to 1.5G.
    Thanks

    Hi Sam,
    Please review the following note, as it might help you!!!
    Tuning Output Post Processor (OPP) to Improve Performance (Doc ID 1399454.1)
    R12: How to Configure the Account Analysis Report for Large Reports (Doc ID 737311.1)
    Thanks &
    Best Regards,

  • How to increase Memory and Java Heap Size for Content Server

    Hi,
    My content server is processing requests very slowly. Over performance is not good. I have 2 GB of RAM any idea what files I can modify to increase the Java Heap Size for the Content Server. If I increase the RAM to 4 or 6 GB where do I need to make changes for the Java Heap Size and what are the recommended values. I just have Content Server Running on the linux box. Or how do I assign more memory to the user that owns the content server install.
    Thanks

    You might find these interesting:
    http://blogs.oracle.com/fusionecm/2008/10/how_to_-javatuning.html
    http://download.oracle.com/docs/cd/E10316_01/cs/cs_doc_10/documentation/admin/performance_tuning_10en.pdf
    Do you have access to metalink? This has about everything you could want:
    https://metalink2.oracle.com/metalink/plsql/f?p=130:14:9940589543422282072::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,788210.1,1,1,1,helvetica
    Or search for "788210.1" in metalink knowledgebase if that link doesn't work and look for the FAQ on configuring Java for Content Servers

  • Setting memory heap size

    Hi,
    I would like to know how to set the default memory
    heap size to 128 MB while installing the Java Plugin
    itself.
    Is there any environment variable available for setting
    this?
    I dont want to use the Control Panel option for setting
    it.
    Thanks for your help.

    Hey i have the same issue, how did you solve it?
    Hi Gkumarc1,
    Plugin 1.3.0 (and after) reads the property filein
    .java directory of user's home directory. Java
    runtime parameter is saved in the property file.Here
    is an example of it:
    # Java(TM) Plug-in Properties
    # DO NOT EDIT THIS FILE. It is machine generated.
    # Use the Activator Control Panel to editproperties.
    javaplugin.jre.params=-Xmx 128m
    Hope this helps.
    Sun-DTSIs there a way to set the default heap size on the
    fly? Meaning, we want to avoid the need for our
    customers to go into their control panel and make
    this setting. Instead, we would like to have the
    applet load with our preferred default VM size. This
    would allow us to change the preferred size during
    some future performance enchancements without having
    to contact all of our 2,000+ external customers. Is
    there something that can be put in the PARAM tag
    within the HTML that specifies the
    preferred/recommended default size?
    Any help would be greatly appreciated.

  • Setting Heap Size from JAR

    Hi,
    Does anybody know here how to specify the Heap size with JAR.
    From command line, I type java -jar -ms128M -mx350M IzoneIDE.jar
    My jar file is executable, so how can I specify the heap size in Jar Files.
    Please dont comment this as a Cross Post as I dont find any answer in Java Programming forum, thats why I post it here.
    Thanks
    Raheel

    Check here, http://java.sun.com/docs/books/tutorial/jar/
    not sure if the right info is there, but If you do find it pls let us know.
    ICE

  • Memory Notification:Library Cache Object loaded in Heap size 2262K exceeds

    Dear all
    I am facing the following problem. I am using Oracle 10gR2 on Windows.
    Please help me.
    Memory Notification: Library Cache Object loaded into SGA
    Heap size 2262K exceeds notification threshold (2048K)
    KGL object name :XDB.XDbD/PLZ01TcHgNAgAIIegtw==
    Thanks

    This is a normal warning message displayed for release 10.2.0.1.0, this is just a bug that by default has declared the kgllarge_heap_warning_threshold instance parameter to 8388608 . The bug is harmless, but the problem is that you will see a lot of messages displayed on the alert.log file, which renders this file difficult to read and it is uncomfortable to spot the real errors.
    Just declare a higher value for the kgllarge_heap_warning_threshold undocumented instance parameter. This is meant to be corrected at 10.2.0.2.0, but you can manually have this parameter increased to a value higher than the highest value reported.
    For further references take a look at this metalink note:
    Memory Notification: Library Cache Object Loaded Into Sga
         Doc ID:      Note:330239.1
    ~ Madrid
    http://hrivera99.blogspot.com/

  • Retrieve Heap size from program

    Hi, i searched the foruns with "get heap size" and "retrieve size"
    and i also checked the System.getProperty(String key) string keys at
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/System.html#getProperty(java.lang.String)
    and havent found a method to retrieve the currently set heap size.
    Is there a way to do this?
    My program needs to initialize something based on how large the
    user set the heap size (using the command line -Xms32m -Xmx128m...)
    Any info would be appreciated! Thanks alot!

    Touche!
    Thanks alot you pointed me in exactly the right direction.
    When i did research on java.lang.Runtime
    i found this post
    http://forums.java.sun.com/thread.jspa?threadID=529065&start=0&tstart=165
    which is a great two page thread on this subject.
    Runtime
    http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#maxMemory()

  • Nio ByteBuffer and memory-mapped file size limitation

    I have a question/issue regarding ByteBuffer and memory-mapped file size limitations. I recently started using NIO FileChannels and ByteBuffers to store and process buffers of binary data. Until now, the maximum individual ByteBuffer/memory-mapped file size I have needed to process was around 80MB.
    However, I need to now begin processing larger buffers of binary data from a new source. Initial testing with buffer sizes above 100MB result in IOExceptions (java.lang.OutOfMemoryError: Map failed).
    I am using 32bit Windows XP; 2GB of memory (typically 1.3 to 1.5GB free); Java version 1.6.0_03; with -Xmx set to 1280m. Decreasing the Java heap max size down 768m does result in the ability to memory map larger buffers to files, but never bigger than roughly 500MB. However, the application that uses this code contains other components that require the -xMx option to be set to 1280.
    The following simple code segment executed by itself will produce the IOException for me when executed using -Xmx1280m. If I use -Xmx768m, I can increase the buffer size up to around 300MB, but never to a size that I would think I could map.
    try
    String mapFile = "C:/temp/" + UUID.randomUUID().toString() + ".tmp";
    FileChannel rwChan = new RandomAccessFile( mapFile, "rw").getChannel();
    ByteBuffer byteBuffer = rwChan.map( FileChannel.MapMode.READ_WRITE,
    0, 100000000 );
    rwChan.close();
    catch( Exception e )
    e.printStackTrace();
    I am hoping that someone can shed some light on the factors that affect the amount of data that may be memory mapped to/in a file at one time. I have investigated this for some time now and based on my understanding of how memory mapped files are supposed to work, I would think that I could map ByteBuffers to files larger than 500MB. I believe that address space plays a role, but I admittedly am no OS address space expert.
    Thanks in advance for any input.
    Regards- KJ

    See the workaround in http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4724038

  • Maximum heap size for 64bit JVM

    Hi,
    I am trying to set the maximum heap size for a java process in a 64bit JVM . I am not able to set more then 3G
    command line config:
    java -Xms64m -Xmx3g -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=8000 com.superpages.puboptions.CampaignFeedStarter >> publisher.out 2>&1 &
    Hardware / software configs
    *$uname -a*
    SunOS labsbear 5.9 Generic_122300-19 sun4u sparc SUNW,Sun-Fire-V440
    *16GB total physical memory*
    *4 processor machine*
    *64 bit JVM*
    JDK1.6
    where is this limitation coming from. How to set the heap size to 6g.
    Thanks for your time
    Meena

    You need to use the -d64 switch to request the 64-bit JVM. E.g.,$ java -showversion -Xmx6g HelloWorld
    Invalid maximum heap size: -Xmx6g
    The specified size exceeds the maximum representable size.
    Could not create the Java virtual machine.
    $ java -showversion -d64 -Xmx6g HelloWorld
    java version "1.6.0_07"
    Java(TM) SE Runtime Environment (build 1.6.0_07-b04)
    Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)
    Hello world!

  • Set the heap size

    Hi,
    I am wondering what's the default heap size if I don't add -ms -mx opation? I
    set the two options and the following is the output from -verbosegc. what's it
    means?
    Thanks.
    [GC 2598K->2145K(2696K), 0.0035829 secs]
    [GC 2656K->2201K(2824K), 0.0036262 secs]
    [Full GC 2713K->2070K(4028K), 0.1933980 secs]
    [GC 2582K->2229K(4028K), 0.0046565 secs]
    [GC 2741K->2373K(4028K), 0.0061002 secs]
    [GC 2885K->2514K(4028K), 0.0064346 secs]
    [GC 3026K->2656K(4028K), 0.0061670 secs]
    [GC 3168K->2798K(4028K), 0.0054694 secs]
    [GC 3310K->2940K(4028K), 0.0054521 secs]
    [GC 3452K->3080K(4028K), 0.0058119 secs]
    [GC 3592K->3216K(4028K), 0.0059069 secs]
    [GC 3728K->3357K(4028K), 0.0057200 secs]
    [GC 3869K->3496K(4028K), 0.0055719 secs]
    [GC 4008K->3636K(4156K), 0.0057239 secs]
    [Full GC 4148K->3649K(6544K), 0.3064887 secs]
    [GC 4091K->3773K(6544K), 0.0412259 secs]
    [GC 4285K->3912K(6544K), 0.0052336 secs]
    [GC 4424K->4051K(6544K), 0.0055661 secs]
    [GC 4563K->4189K(6544K), 0.0055543 secs]
    [GC 4701K->4326K(6544K), 0.0055703 secs]
    [GC 4838K->4464K(6544K), 0.0055915 secs]
    [GC 4976K->4608K(6544K), 0.0059667 secs]
    [GC 5120K->4746K(6544K), 0.0053261 secs]
    [GC 5258K->4884K(6544K), 0.0053761 secs]
    [GC 5396K->5023K(6544K), 0.0059290 secs]
    [GC 5534K->5159K(6544K), 0.0054320 secs]
    [GC 5671K->5301K(6544K), 0.0114341 secs]
    [GC 5813K->5405K(6544K), 0.0103658 secs]
    [GC 5917K->5492K(6544K), 0.0053194 secs]
    [GC 6003K->5592K(6544K), 0.0107092 secs]
    [GC 6104K->5694K(6544K), 0.0096887 secs]
    [GC 6206K->5786K(6544K), 0.0037949 secs]
    [GC 6298K->5890K(6544K), 0.0101172 secs]
    [GC 6402K->5990K(6544K), 0.0041271 secs]
    [GC 6502K->6097K(6672K), 0.0040678 secs]
    [Full GC 6609K->6191K(10992K), 0.2664733 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: EMAIL TEMPLATE
    C
    ACHE STARTING
    [GC 6849K->6361K(10992K), 0.0586387 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: SCHEDULE CACHE
    S
    TARTING
    [GC 7129K->6530K(10992K), 0.0083019 secs]
    [GC 7298K->6678K(10992K), 0.0058533 secs]
    [GC 7446K->6807K(10992K), 0.0052940 secs]
    [GC 7575K->6920K(10992K), 0.0048598 secs]

    I think the default heap size is 16MB, as for the GC output:
    these [GC 2598K->2145K(2696K), 0.0035829 secs]
    show the collection of Objects within the eden area of the heap (Short lived Objects),
    the heap size before GC was 2598K and after GC was 2145K and the time taken was
    0.0035829 secs.
    These outputs:
    [Full GC 2713K->2070K(4028K), 0.1933980 secs]
    show the details for a full GC, these are the ones to watch out for, they will
    take longer and the JVM (no mater how many processors) will block during a full
    GC....I.E no server response at all.
    The smaller the heap size the more often a full GC will occur, however the larger
    the heap, the longer the full GC will take.
    One of the new options for jdk 1.3.1 is the -Xincgc option, this will do incremental
    Garbage Collection, overall it will take longer than normal, but the individual
    Full GCs will take less time....so the server is not hung for as long at any one
    time.
    Set -Xms (the minimum heap) to the same as -Xmx (max heap), this increases performance
    as the JVM does not have to repeatedly assign more memory to the heap.
    Gareth
    "Jen" <[email protected]> wrote:
    >
    Hi,
    I am wondering what's the default heap size if I don't add -ms -mx opation?
    I
    set the two options and the following is the output from -verbosegc.
    what's it
    means?
    Thanks.
    [GC 2598K->2145K(2696K), 0.0035829 secs]
    [GC 2656K->2201K(2824K), 0.0036262 secs]
    [Full GC 2713K->2070K(4028K), 0.1933980 secs]
    [GC 2582K->2229K(4028K), 0.0046565 secs]
    [GC 2741K->2373K(4028K), 0.0061002 secs]
    [GC 2885K->2514K(4028K), 0.0064346 secs]
    [GC 3026K->2656K(4028K), 0.0061670 secs]
    [GC 3168K->2798K(4028K), 0.0054694 secs]
    [GC 3310K->2940K(4028K), 0.0054521 secs]
    [GC 3452K->3080K(4028K), 0.0058119 secs]
    [GC 3592K->3216K(4028K), 0.0059069 secs]
    [GC 3728K->3357K(4028K), 0.0057200 secs]
    [GC 3869K->3496K(4028K), 0.0055719 secs]
    [GC 4008K->3636K(4156K), 0.0057239 secs]
    [Full GC 4148K->3649K(6544K), 0.3064887 secs]
    [GC 4091K->3773K(6544K), 0.0412259 secs]
    [GC 4285K->3912K(6544K), 0.0052336 secs]
    [GC 4424K->4051K(6544K), 0.0055661 secs]
    [GC 4563K->4189K(6544K), 0.0055543 secs]
    [GC 4701K->4326K(6544K), 0.0055703 secs]
    [GC 4838K->4464K(6544K), 0.0055915 secs]
    [GC 4976K->4608K(6544K), 0.0059667 secs]
    [GC 5120K->4746K(6544K), 0.0053261 secs]
    [GC 5258K->4884K(6544K), 0.0053761 secs]
    [GC 5396K->5023K(6544K), 0.0059290 secs]
    [GC 5534K->5159K(6544K), 0.0054320 secs]
    [GC 5671K->5301K(6544K), 0.0114341 secs]
    [GC 5813K->5405K(6544K), 0.0103658 secs]
    [GC 5917K->5492K(6544K), 0.0053194 secs]
    [GC 6003K->5592K(6544K), 0.0107092 secs]
    [GC 6104K->5694K(6544K), 0.0096887 secs]
    [GC 6206K->5786K(6544K), 0.0037949 secs]
    [GC 6298K->5890K(6544K), 0.0101172 secs]
    [GC 6402K->5990K(6544K), 0.0041271 secs]
    [GC 6502K->6097K(6672K), 0.0040678 secs]
    [Full GC 6609K->6191K(10992K), 0.2664733 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: EMAIL
    TEMPLATE
    C
    ACHE STARTING
    [GC 6849K->6361K(10992K), 0.0586387 secs]
    Tue Dec 04 15:22:10 PST 2001:<I> <T3Services> CacheManagerImpl: SCHEDULE
    CACHE
    S
    TARTING
    [GC 7129K->6530K(10992K), 0.0083019 secs]
    [GC 7298K->6678K(10992K), 0.0058533 secs]
    [GC 7446K->6807K(10992K), 0.0052940 secs]
    [GC 7575K->6920K(10992K), 0.0048598 secs]

  • How to increase the heap size of the container in whioch BPEL is running ?

    Hi All,
    I recently raised an SR they have asked me to do the following,
    Can you please try and start the container running the BPEL process with max
    heap space (-Xmx) of 2 GB and the eden space (-Xmn) at about 60% of 1228m and
    the option -XX:+AggressiveHeap set. (even though this option is recommended for
    multi processor machines say 4)
    can anyone kindly explain me how to increase the Heap size and Eden size of BPEL container ?
    Thank You

    Hi Deepak I cant see any attribute or element in the oc4j_opmn.xml file regarding heap memory. In the server properties I changed the size of heap memeory how can I rollback.
    I am getting the following error
    Configuration information
    Running in C:\product\10.1.3.1\OracleAS_1
    Operation mode:Startup, App Server, No Enterprise Manager, Single Instance
    Oracle home:C:\product\10.1.3.1\OracleAS_1
    Oracle home name:Unnamed
    Instance name:SOA.01hw117905.India.TCS.com
    Instance type:allProducts
    Version:10.1.3.4.0
    Uses infrastructure:false
    Not an infrastructure instance, no infrastructure information available
    Components:[j2ee, apache, orabpel, oraesb, owsm, Wsil]
    2009-08-19 09:08:51.863--Begin log output for Mid-tier services (SOA.01hw117905.India.TCS.com)
    2009-08-19 09:08:51.863--Processing Step: starting OPMN
    2009-08-19 09:09:00.394--Processing Step: starting OPMN managed processes
    2009-08-19 09:09:35.19--End log output for Mid-tier services (SOA.01hw117905.India.TCS.com)
    An unknown OPMN error has occured
    oracle.appserver.startupconsole.model.ConsoleException: An unknown OPMN error has occured
         at oracle.appserver.startupconsole.control.OPMNController.doStart(OPMNController.java:121)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.control.GroupController.doStart(GroupController.java:47)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.view.controller.ControllerAdapter.start(ControllerAdapter.java:30)
         at oracle.appserver.startupconsole.view.controller.MasterControlAdapter.run(MasterControlAdapter.java:94)
         at oracle.appserver.startupconsole.view.Runner.main(Runner.java:39)
    Caused by: oracle.ias.opmn.optic.OpticControlException: Error from opmn during process control operation
         at oracle.ias.opmn.optic.AbstractOpmnEntity.runCommand(AbstractOpmnEntity.java:174)
         at oracle.ias.opmn.optic.AbstractOpmnEntity.start(AbstractOpmnEntity.java:110)
         at oracle.appserver.startupconsole.control.OPMNController.doStart(OPMNController.java:89)
         ... 6 more
    Exception caused by
    Error from opmn during process control operation
    oracle.ias.opmn.optic.OpticControlException: Error from opmn during process control operation
         at oracle.ias.opmn.optic.AbstractOpmnEntity.runCommand(AbstractOpmnEntity.java:174)
         at oracle.ias.opmn.optic.AbstractOpmnEntity.start(AbstractOpmnEntity.java:110)
         at oracle.appserver.startupconsole.control.OPMNController.doStart(OPMNController.java:89)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.control.GroupController.doStart(GroupController.java:47)
         at oracle.appserver.startupconsole.control.Controller.start(Controller.java:69)
         at oracle.appserver.startupconsole.view.controller.ControllerAdapter.start(ControllerAdapter.java:30)
         at oracle.appserver.startupconsole.view.controller.MasterControlAdapter.run(MasterControlAdapter.java:94)
         at oracle.appserver.startupconsole.view.Runner.main(Runner.java:39)
    <?xml version='1.0' encoding='WINDOWS-1252'?>
    <response>
    <msg code="-82" text="Remote request with weak authentication.">
    </msg>
    <opmn id="01hw117905:6200" http-status="206" http-response="2 of 3 processes started.">
    <ias-instance id="SOA.01hw117905.India.TCS.com">
    <ias-component id="default_group">
    <process-type id="home">
    <process-set id="default_group">
    <process id="172" pid="2176" status="Alive" index="1" log="C:\product\10.1.3.1\OracleAS_1\opmn\logs\\default_group~home~default_group~1.log" operation="request" result="success">
    <msg code="0" text="">
    </msg>
    </process>
    </process-set>
    </process-type>
    <process-type id="oc4j_soa">
    <process-set id="default_group">
    <process id="173" pid="5556" status="Stopped" index="1" log="C:\product\10.1.3.1\OracleAS_1\opmn\logs\\default_group~oc4j_soa~default_group~1.log" operation="request" result="failure">
    <msg code="-21" text="failed to start a managed process after the maximum retry limit">
    </msg>
    </process>
    </process-set>
    </process-type>
    </ias-component>
    <ias-component id="HTTP_Server">
    <process-type id="HTTP_Server">
    <process-set id="HTTP_Server">
    <process id="171" pid="2724" status="Alive" index="1" log="C:\product\10.1.3.1\OracleAS_1\opmn\logs\\HTTP_Server~1.log" operation="request" result="success">
    <msg code="0" text="">
    </msg>
    </process>
    </process-set>
    </process-type>
    </ias-component>
    </ias-instance>
    </opmn>
    </response>

Maybe you are looking for

  • Voice memos do not transfer to PC

    Hello everyone: I have been reading a lot about this subject in Apple Support Communities. But I haven't found any answer that works for me. I have some voice memos in my iPhone 4. Every time I sync the iPhoen with my computer (PC) the voice memos tr

  • Problem with jsp in sub-directories

    hello I have uploaded my site on one the server in public_html. And in public_html. there are 2 directories admin and segments. segments directory contains setup.jsp file. admin directory contains test.jsp file that includes file setup.jsp which is i

  • Date range in function module

    Hi guys,              i have a selection screen where i need to give range of date. say from 01.01.1998 to 01.02.2007. i need to pass this date range to 'Z' funtion module how can i do it. do i need to define it in tables declaration. if yes what wil

  • X Axis labels in Chart background elements

    I want to display the X-axis labels in Chart background area something like this Has anyone implemented this before? Please help me how to do this?

  • Photos are not attachments when emailed

    My friend and I have identical iPhones. When I attach a photo from the camera roll in an email and send it to myself or her, it is embedded as a photo and also is an attachment. Our email provider is the same also. When she does the same thing, the e