Setting the heap size

Hi all,
I wanted to ask you about setting the heap size value.
How we can calculate the heap size?
I had problems with the max heap size in my application.
So I increased the max value to 2048 MB, but I am afraid that
the same error may come up again some time depending upon the
usage.
So how I can find, say for a server having 2 GB RAM,
how much heap size I should give? I read that there is no defined
formula to calculate this. But I wanted to get the best way of doing it.
Please advise,
Sandeep

As has already been said, you probably have a leak. However, when trying to gauge the maximum heap you can (not should, but can) use you have to take into account what the server is doing, and its operating system. You do not want your JVM to page. So, for a 2GB server, with no other app on it, I think the "usual" is something like 75% max? Though I really wouldn't take my word for it...it's not my field.

Similar Messages

  • How to set the heap size of JVM

    please let me know that how to set the heap size of JVM

    C:\>java -X
        -Xmixed           mixed mode execution (default)
        -Xint             interpreted mode execution only
        -Xbootclasspath:<directories and zip/jar files separated by ;>
                          set search path for bootstrap classes and resources
        -Xbootclasspath/a:<directories and zip/jar files separated by ;>
                          append to end of bootstrap class path
        -Xbootclasspath/p:<directories and zip/jar files separated by ;>
                          prepend in front of bootstrap class path
        -Xnoclassgc       disable class garbage collection
        -Xincgc           enable incremental garbage collection
        -Xbatch           disable background compilation
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap size
        -Xss<size>        set java thread stack size
        -Xprof            output cpu profiling data
        -Xrunhprof[:help]|[:<option>=<value>, ...]
                          perform JVMPI heap, cpu, or monitor profiling
        -Xdebug           enable remote debugging
        -Xfuture          enable strictest checks, anticipating future default
        -Xrs              reduce use of OS signals by Java/VM (see documentation)look at the -Xm? lines
        -Xms<size>        set initial Java heap size
        -Xmx<size>        set maximum Java heap sizeThis can be used e.g. like this:java -Xms8M -Xmx32M MyProgwhich runs MyProg in a java VM with the initial heap size of 8 MB and a maximum heap size of 32 MB.
    - Marcus

  • 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.

  • 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 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?

  • Is it possible to set the heap size limits in system-wide config?

    Hi,
    I am trying to set the JRE heap size limits (-Xms and -Xmx) by using the system-level deployment.properties file. The JRE version is 1.6 update 6.
    Normally, I would have something like this in the user-level deployment.properties file:
    deployment.javapi.jre.1.6.0_06.args=-Xms64M -Xmx192MHowever, when the same line is put in the system-level properties, it does not seem to have any effect. I have tried different options, also unsuccessfully:
    javaplugin.vm.options=-Xms64M -Xmx192M
    or
    javaplugin.minHeapSize=64m
    javaplugin.maxHeapSize=192mIs it not possible to address this setting via system-level properties at all? I am hoping that I will not have to resort to per-user config files.
    Best regards,
    Martin

    Hi Michael,
    thank you for your answer. I am sorry, I was unable to find the link to the message 10144001.
    My ultimate goal would be setting the system level settings as opposed to settings per applet. I was unable to find any mentioning of "deployment.javapi.jre.X.X.X_XX.args" in the official documentation here: http://java.sun.com/j2se/1.5.0/docs/guide/deployment/deployment-guide/properties.html
    Best regards,
    Martin

  • Plz can you help me. How to increase the Heap Size!!!!!!!!!!!

    Hi,
    i'm new to 10g appl server
    Failed to deploy web application "AGXI51". Failed to deploy web application "AGXI51". . The evaluate phase failed. The Adapter used in the evaluate may have thrown an exception.
    Resolution:
    Please call Oracle support.
    Base Exception:
    java.lang.OutOfMemoryError
    null. java.lang.OutOfMemoryError
    i'm getting this Error while deploying the application.So wat is the procedure to increase the Heap Size
    Regards,
    Niranjan.D

    Locate opmn.xml on your instance. In file locate section relevant for container you use (i.e. "home"). In next line you can see tags where startup parameters are set. You should add following parameters (this will set heap size on 512Mb)
    -Xms512m -Xmx512m
    For detailed explanation I would recommend you to check following link:
    http://download-uk.oracle.com/docs/cd/B25221_03/web.1013/b14431/troublesht.htm
    Hope this help.

  • Upto how much I can set maximum Heap size for jvm?

    I am running application on 8GB RAM Windows 64 bits machine.
    I am running out of OutOfMemory (Heap Space). I want to increase the Heap Size for my jvm.
    But can anybody please tell me what is the limit by which I can set the maximum size for heap?
    Thanks in Advance,
    Jenish

    Max allowed memory per process is 2 raised to the 64th power. What maximum memory you can set depends on the memory available
    for your application. You may be able to set more than 8GB ram then it will use the swap space and it will slow down your application
    performance. So try different memory size and see which one works best for your application.

  • 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>

  • How do I set the frame size

    I am Making a program for purchasing games, with the basic layout alsot done, except on problem. When the purchase button is pressed, a dialog shows up but nothing is seen until i resize it. How would i set the frame size so that i do not need to resize it each time? below is the code for the files. Many thanks in advance.
    CreditDialog
    import java.awt.*;
    import java.awt.event.*;
    class CreditDialog extends Dialog implements ActionListener { // Begin Class
         private Label creditLabel = new Label("Message space here",Label.RIGHT);
         private String creditMessage;
         private TextField remove = new TextField(20);
         private Button okButton = new Button("OK");
         public CreditDialog(Frame frameIn, String message) { // Begin Public
              super(frameIn); // call the constructor of dialog
              creditLabel.setText(message);
              add("North",creditLabel);
              add("Center",remove);
              add("South",okButton);
              okButton.addActionListener(this);
              setLocation(150,150); // set the location of the dialog box
              setVisible(true); // make the dialog box visible
         } // End Public
         public void actionPerformed(ActionEvent e) { // Begin actionPerformed
    //          dispose(); // close dialog box
         } // End actionPerformed
    } // End Class
    MobileGame
    import java.awt.*;
    import java.awt.event.*;
    class MobileGame extends Panel implements ActionListener { // Begin Class
         The Buttons, Labels, TextFields, TextArea 
         and Panels will be created first.         
         private int noOfGames;
    //     private GameList list;
         private Panel topPanel = new Panel();
         private Panel middlePanel = new Panel();
         private Panel bottomPanel = new Panel();
         private Label saleLabel = new Label ("Java Games For Sale",Label.RIGHT);
         private TextArea saleArea = new TextArea(7, 25);
         private Button addButton = new Button("Add to Basket");
         private TextField add = new TextField(3);
         private Label currentLabel = new Label ("Java Games For Sale",Label.RIGHT);
         private TextArea currentArea = new TextArea(3, 25);
         private Button removeButton = new Button("Remove from Basket");
         private TextField remove = new TextField(3);
         private Button purchaseButton = new Button("Purchase");
         private ObjectList gameList = new ObjectList(20);
         Frame parentFrame; //needed to associate with dialog
         All the above will be added to the interface 
         so that they are visible to the user.        
         public MobileGame (Frame frameIn) { // Begin Constructor
              parentFrame = frameIn;
              topPanel.add(saleLabel);
              topPanel.add(saleArea);
              topPanel.add(addButton);
              topPanel.add(add);
              middlePanel.add(currentLabel);
              middlePanel.add(currentArea);
              bottomPanel.add(removeButton);
              bottomPanel.add(remove);
              bottomPanel.add(purchaseButton);
              this.add("North", topPanel);
              this.add("Center", middlePanel);
              this.add("South", bottomPanel);
              addButton.addActionListener(this);
              removeButton.addActionListener(this);
              purchaseButton.addActionListener(this);
              The following line of code below is 
              needed inorder for the games to be  
              loaded into the SaleArea            
         } // End Constructor
         All the operations which will be performed are  
         going to be written below. This includes the    
         Add, Remove and Purchase.                       
         public void actionPerformed (ActionEvent e) { // Begin actionPerformed
         If the Add to Basket Button is pressed, a       
         suitable message will appear to say if the game 
         was successfully added or not. If not, an       
         ErrorDialog box will appear stateing the error. 
              if(e.getSource() == addButton) { // Begin Add to Basket
    //          GameFileHandler.readRecords(list);
                   try { // Begin Try
                        String gameEntered = add.getText();
                        if (gameEntered.length() == 0 ) {
                             new ErrorDialog (parentFrame,"Feild Blank");
                        } else if (Integer.parseInt(gameEntered)< 0
                                  || Integer.parseInt(gameEntered)>noOfGames) { // Begin Else If
                             new ErrorDialog (parentFrame,"Invalid Game Number");
                        } else { // Begin Else If
                             //ADD GAME
                        } // End Else
                   } catch (NumberFormatException num) { // Begin Catch
                        new ErrorDialog(parentFrame,"Please enter an Integer only");
                   } // End Catch
              } // End Add to Basket
         If the Remove From Basket Button is pressed, a  
         a suitable message will appear to say if the    
         removal was successful or not. If not, an       
         ErrorDialog box will appear stateing the error. 
         if(e.getSource() == removeButton) { // Begin Remove from Basket
              try { // Begin Try
                        String gameEntered = remove.getText();
                        if (gameEntered.length() == 0 ) {
                             new ErrorDialog (parentFrame,"Feild Blank");
                        } else if (Integer.parseInt(gameEntered)< 1
                                  || Integer.parseInt(gameEntered)>noOfGames) { // Begin Else If
                             new ErrorDialog (parentFrame,"Invalid Game Number");
                        } else { // Begin Else If
                             //ADD GAME CODE
                        } // End Else
                   } catch (NumberFormatException num) { // Begin Catch
                        new ErrorDialog(parentFrame,"Please enter an Integer only");
                   } // End Catch
              } // End Remove from Basket
         If the purchase button is pressed, the          
         following is executed. NOTE: nothing is done    
         when the ok button is pressed, the window       
         just closes.                                    
              if(e.getSource() == purchaseButton) { // Begin Purchase
                   String gameEntered = currentArea.getText();
                   if (gameEntered.length() == 0 ) {
                        new ErrorDialog (parentFrame,"Nothing to Purchase");
                   } else { // Begin Else If
                        new CreditDialog(parentFrame,"Cost � 00.00. Please enter Credit Card Number");
                   } // End Else               
              } // End Purchase
         } // End actionPerformed
    } // End Class
    RunMobileGame
    import java.awt.*;
    public class RunMobileGame { // Begin Class
         public static void main (String[] args) { // Begin Main
              EasyFrame frame = new EasyFrame();
              frame.setTitle("Game Purchase for 3G Mobile Phone");
              MobileGame purchase = new MobileGame(frame); //need frame for dialog
              frame.setSize(500,300); // sets frame size
              frame.setBackground(Color.lightGray); // sets frame colour
              frame.add(purchase); // adds frame
              frame.setVisible(true); // makes the frame visible
         } // End Main
    } // End Class
    EasyFrame
    import java.awt.*;
    import java.awt.event.*;
    public class EasyFrame extends Frame implements WindowListener {
    public EasyFrame()
    addWindowListener(this);
    public EasyFrame(String msg)
    super(msg);
    addWindowListener(this);
    public void windowClosing(WindowEvent e)
    dispose();
    public void windowDeactivated(WindowEvent e)
    public void windowActivated(WindowEvent e)
    public void windowDeiconified(WindowEvent e)
    public void windowIconified(WindowEvent e)
    public void windowClosed(WindowEvent e)
    System.exit(0);
    public void windowOpened(WindowEvent e)
    } // end EasyFrame class
    ObjectList
    class ObjectList
    private Object[] object ;
    private int total ;
    public ObjectList(int sizeIn)
    object = new Object[sizeIn];
    total = 0;
    public boolean add(Object objectIn)
    if(!isFull())
    object[total] = objectIn;
    total++;
    return true;
    else
    return false;
    public boolean isEmpty()
    if(total==0)
    return true;
    else
    return false;
    public boolean isFull()
    if(total==object.length)
    return true;
    else
    return false;
    public Object getObject(int i)
    return object[i-1];
    public int getTotal()
    return total;
    public boolean remove(int numberIn)
    // check that a valid index has been supplied
    if(numberIn >= 1 && numberIn <= total)
    {   // overwrite object by shifting following objects along
    for(int i = numberIn-1; i <= total-2; i++)
    object[i] = object[i+1];
    total--; // Decrement total number of objects
    return true;
    else // remove was unsuccessful
    return false;
    ErrorDialog
    import java.awt.*;
    import java.awt.event.*;
    class ErrorDialog extends Dialog implements ActionListener {
    private Label errorLabel = new Label("Message space here",Label.CENTER);
    private String errorMessage;
    private Button okButton = new Button("OK");
    public ErrorDialog(Frame frameIn, String message) {
    /* call the constructor of Dialog with the associated
    frame as a parameter */
    super(frameIn);
    // add the components to the Dialog
              errorLabel.setText(message);
              add("North",errorLabel);
    add("South",okButton);
    // add the ActionListener
    okButton.addActionListener(this);
    /* set the location of the dialogue window, relative to the top
    left-hand corner of the frame */
    setLocation(100,100);
    // use the pack method to automatically size the dialogue window
    pack();
    // make the dialogue visible
    setVisible(true);
    /* the actionPerformed method determines what happens
    when the okButton is pressed */
    public void actionPerformed(ActionEvent e) {
    dispose(); // no other possible action!
    } // end class
    I Know there are alot of files. Any help will be much appreciated. Once again, Many thanks in advance

    setSize (600, 200);orpack ();Kind regards,
      Levi
    PS:
        int i;
    parses to
    int i;
    , but
    [code]    int i;[code[i]]
    parses to
        int i;

  • How do I set the Page size default in Adobe Reader using Window 8?

    I need to set the page size everytime I go to print from my Adobe Reader in my windows 8. Is there a way to set the page I want letter (8.5 by 11) as a default? So I do not have to do this everytime I print something?

    I can't help but wonder why Adobe doesn't respond to this - at this point there are 464 views of this item and still no answer. I have the same problem and it's a big irritation to have to set the duplex mode everytime I want to print!

  • How can I set the font size of a form field in the fdf file?

    I need to dynamically set the font size of a field to accommodate text of varying length, automatic font size won't work in this case. It seems like this can be done in the FDF but I have tried several variants without success. Could someone help out with a real example of what the syntax in the fdf should look like.
    I am using Acrobat Professional 8.1 but the created fdf will need to work with Reader also.

    I think that the font size has to be set in the form itself, not the FDF.

  • How do I set the default size of a new folder?

    I have finder sized the way I want for existing folders and if I do Finder > New Finder Window. These preferrences, however, do not seem to apply to new folders. Everytime I create a new folder on my desktop, and open that folder for the first time, the window size is really small and the sidebar is narrow. This is incredibally annoying. How do I set the default size for all new folders? Is there a plist file I can edit to fix this? Or an AppleScript I can run automatically in the background that fixes this? I am running Mavericks 10.9.1.

    If you use the Finder's New Finder Window command (command N) to create a new window, resize it, place it where you want, and set it for icon view or however you want it. Then close it. Closing it is what sets these as the default. That should become the default for every new Finder window you create using the new window command. But if you have lots of windows open at once and then close them, the last window you close will set a new default.
    There are lots of utilities that control Windows - their size and placement. I use one called Moom but there are many more.

  • HT5639 I am attempting to install windows 7 ultimate on a mid2012 production macbook pro using Bootcamp 5 in Mountain Lion. Whenever I set the partition size and tell it to continue, the program quits unexpectedly. I have done this about 5 times now. Sugg

    The lead-in above pretty much states the problem. I am attempting to install Windows 7 from a disk, but that is not the issue. Boot Camp 5 just quits and reopens. I then repeat. Help.

    I am about to run specialized GIS software that may or may not need the full machine resources. I am an attorney who uses QuickBooks for my accounting. The Mac version does not do as much as the Windows version. This is from both Apple and Quick Books professionals. I am using Parallels Desktop version 8 at this time. It does not support QuickBooks Windows version per Parallels. Any other questions? I am a highly competent PC user who is new to Macs. I am entitled to my own configuration choices. That said, I know when I need help which is now.
    As to the free space issue I have 665.18 GB free space out of 749.3 GB on the drive. I am not trying to run the 32 bit version. I know that it requires the 64 bit version. Besides, it does not get that far in the process. As I said Boot Camp asssitant terminates unexpectedly as soon as you hit the continue button after setting the partition size. Therefore I conclude that it does not have a chance to see which version of Windows that I am using. I am using Windows 7 Ultimate 64 bit version in the virtual engine (to use Parallels speak), but again Boot Camp would not see that since it is not running. It can't run at the momenet because Apple just installed a new hard drive and I have just restored the data from TIme Machine and Parallels needs reactivated, which I have not done yet deliberatley. With all of this addtiional information do you have any further suggestions? Thanks for your time and interest my issue.

  • Hi, I am using Indesign CS6, How to set the page size in Inches.

    Hi, I am using Indesign CS6, How to set the page size in Inches.

    All fields in InDesign can be entered in any measurement system. So, if you want to make an 8"x10" document and go to File>New Document and the window looks like this:
    …you can type either 8 in or 8" into the Width field like this:
    …and when you move to the next field, it will convert the eight inches into the equivalent number in the unit of measure that it is using at the moment, like this:
    … (203.2 milimeters is the same as 8 inches). You can also enter a different measurement unit into other fields once the file is created, such as the width or height of a frame, or the position of an object in the X and Y coordinates.
    If you would rather just work in inches instead of having to type the inches mark or abbreviation, go to InDesign>Preferences>General and select the Units & Increments tab. There you will see Ruler Units for Horizontal and Vertical at the top of the window. Set them to Inches and all of the fields will display in inches. If you do that to an open document, you will change the unit of measure for that document. If you do it while no documents are open, it will change the unit of measure for any new documents you create. To change the unit of measure for existing documents, you will have to open each and make the change.

Maybe you are looking for