How to increase the Java Heap size ?

Hi
I am new to java. I have created a java application and i configured in Eclipse. While running my application it throws an error that
"Exception in thread "Thread-21" java.lang.OutOfMemoryError: Java heap space"
i have used threads in my application. Then i searched some forums regarding this. The answer i got is "Increase the java heap size" using
"java -Xms64m -Xmx256m prog" in command prompt. while running.
But i am not running my application in command prompt. I used Eclipse to run my application. Here my ultimate question is how to set the heap size while running the application in Eclipse and where to set in Eclipse.
Kindly help me.
Regards
Ramesh E

i have used 20 threads to extract the datas
Then parallel i am starting one more thread to process the data. Means that i am starting 21st thread. In thread is throwing the error.
20 threads:
for (int i = 0; i < 20; i++) {
try{
extrThreads[i] = new Thread(this);
extrThreads.start();
}catch (Exception e) {
System.out.println(e);
21st Thread:
public void processdata()throws Exception{
Thread t = new Thread(this);
t.start();
if(t!= null)
t.join();
funtion();
This thread is throwing the error

Similar Messages

  • How to increase the Java Heap Space for a main method

    Hello all,
    after a given number of calculations inside a class with main-method, I get an OutOfMemoryError (Java Heap Size).
    So I'm just trying to increase the Heap Size Creator uses, but it won't work.
    After reading a lot of posts and online-articles, I tried the following:
    1) I changed the -Xms and -Xmx options (to 512m) both in
    $CREATOR/SunAppServer8/domains/creator/config/domain.xml and
    $CREATOR/etc/creator.conf (this file also points to the Creator built-in JDK)
    2) additionally I tried to start Creator from the console with the respective option:
    ./creator -J-Xmx512m
    The memory toolbar shows the right value, but when I use
    System.out.println("JVM maximum memory:\t"+Runtime.getRuntime().maxMemory()/1024+" KB\n");it always says 64 MB, no matter which option I chose in the config-files.
    So how can I increase this value?
    Regards,
    Felix
    Message was edited by:
    Felice
    Message was edited by:
    Felice

    Thank you very much,
    this was an important hint. Additionally I had to create a new "Java Class Library" project with a copy of the needed files (those that are not dependent on the Application Server). Then I could use the option you mentioned.
    Unfortunately, when I try to run the file with
    java -jar FILENAME.jarit won't work, because the archive is not complete: MANIFEST.MF lacks the main-class and all involved libraries.
    I managed to add the main-class attribute manually, but adding all library references seems to be very error-prone.
    So does anyone know if I did something wrong or if this is a bug of Creator?
    Regards,
    Felix

  • How do I increase the JVM heap size

    How do I increase the Java heap space
    i've used java -Xms32m -Xmx256m
    but it just keeps outputing the usage: java [-opetions] class [args...]
    -client
    -server
    -hotspot
    -cp
    -classpath

    htats wrote:
    How do I increase the Java heap space
    i've used java -Xms32m -Xmx256m
    but it just keeps outputing the usage: java [-options] class [args...]Did you give it a class to run?

  • How do we monitor Java heap size

    How do we monitor Java heap size? Is there any way to check whether we are exceeding the heap size or not?
    Regards,
    N.S

    Hi,
    > How do we monitor Java heap size? Is there any way to
    > check whether we are exceeding the heap size or not?
    >
    You should run your JAVA AS with the recommended settings described in the note
    "Java VM settings for J2EE 6.30/6.40/7.0"
    SAP Note Number: 723909.
    If you do so, you can find the garbage collector log messages in your dev_server* or your std_server*.out file.
    You can also use the option -Xloggc:<file> to log to a seperate file.
    You can visualize the GC log file with a tool like GCViewer.
    See
    http://www.javaperformancetuning.com/tools/gcviewer/index.shtml
    for an overview of this tool.
    Regards,
    Markus

  • Any way to increase the default Heap size for all Java VMs in Solaris 8

    Hello,
    I have a java product that deals with large databases under Solaris 8. It is a jar file, started by a cron job every night. Some nights it will fail because it runs out of Heap memory depending on the amount of records it has to deal with. I know that I could increase the java VM heap size with "java -jar -mx YY JARFILE" command but I have other java products that are showing the same behavior, and I would like to correct them all in one shot if possible.
    What I would like to do is find a system or configuration parameter that forces all Java VMs to use a larger MAX Heap size than the default 16M specified in the Man page for Java. Is there a way to accomplish that?
    TIA
    Maizo

    You could always download the source and modify it.

  • Anybody know how to increase the plugin file size limit in Photoshop CS6 to greater than 250 mb?

    Can anyone tell me if it is possible to increase the plugin file size limit in Photoshop CS6 to greater than 250 mb and how to do it? Can plugins running in PSCC handle larger file sizes than CS6?

    Wow, thanks for getting back to me!!
    I am running the latest version of HDR Soft Photomatix Tone Mapping Plug-In - Version 2.2 in Photoshop CS6 on a fully loaded solid state MacBook Air. When I attempt to process files exceeding 250 mb with the plugin I get an error message and the plugin will not work. The plugin works fine with anything south of 250 mb. I have also optimized the performance settings in CS6 for large file sizes.
    The standalone version of HRD Soft’s Photomatix Pro easily processes files well in excess of 300 mb.
    I have contacted Photomatix support and they say that 250megs is simply the max file size that Photoshop will allow to run a plugin with.
    So is there any setting that I’m overlooking in Photoshop CS6 that will allow me to process these large files with the plugin? Or if there is indeed a file size limit for plugin processing in CS6 is the limit higher in CC?
    Thanks in advance for your help.

  • I need help increasing the stack/heap size of my JVM

    I am currently trying to run a recursive quick sort program to sort a reverse sorted array of 60,000. I realize this takes up a lot of memory and may not be the most efficient form of quick sort but I need to get some information from this program run. Everytime i try to run the program I get a stack overflow error. From what I have read on these forums this is due to an inadequate stack/heap. I have read that you just type a line of code in when you start up your JVM to increase the stack/heap but how exactly do you do this? Could someone give me a step by step process? I am new at this so the more details the better. Thanks!

    public static void quickSort(int f, int l){
         if (f < l){
              int m = split(f,l);
              quickSort(f, m-1);
              quickSort(m+1, l);
    public static int split(int f, int l){
         int x = a[f];
         int sp = f;
         for (int i=f+1; i<=l; i++){
              if(a[i] <= x){
                 sp++;
                 swap(i,sp);
         swap(f,sp);
         return sp;               
    // A method to swap values of an array
    public static void swap(int i, int j){
         int temp = a;
         a[i] = a [j];
         a[j] = temp;     
    }Haven't really looked at the code, but basically you'd have a source of randomness (an instance of Random for example) and choose x like this instead:private static Random random = new Random();
    public static int split(int f, int l){
         int x = a[random.nextInt(l-f) + f]; //but check for one-off errors here, I haven't checked this

  • How to set the maximum heap size on a deployed application?

    I�m running a fairly large java application and am getting java.lang.OutOfMemoryError. I could increase the heap size in my development environment to eliminate this error. However, I don�t know how to set this in a deployed application. We are currently using ant to build our software.
    Another question, when I execute a statement such as java �Xmx512M �cp app.jar. Is it correct to say that the application in app.jar will use to a maximum of 512MB of memory when running?
    Thank you everyone for your help!

    But first, when you say "a deployed environment" do you mean an executable .jar file? This is what I'm using.The term "deploy" is commonly used to refer to deploying an ear file or a war file on an application server.
    I would assume that there is some entry you can include in the .jar's
    Manifest.mf file to specify the maximum memory, but I can't find an example of the entry. <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6197671"></a>

  • How to see the Java VM size?

    i want to see in my tomcat server how much memory size allotted & utilized.. (i have purchased the tomcat serverfrom someone..)
    i just want to check the heap size allotted to my application..
    can anyone tell me how to do it ? ( command line or java programs)
    Message was edited by:
    loguKK

    i want to see in my tomcat server how much memory
    size allotted & utilized.. (i have purchased the
    tomcat serverfrom someone..)
    lol You were ripped off, man. Tomcat's free.
    i just want to check the heap size allotted to my
    application..use the verbose:gc flag.

  • How to increase the .avi movie size in Encore.

    Hi
    I have imported the .avi assets from PE4. When I playbacked the movie in Encore DVD 2.0, I found the picture size is too small so I want to increase the height of the picture. I tried using the scale up botton in motion option but it didn't work. After I scaled it up, the movie got a little blurry and delayed the audio.
    Please anyone have any idea how to do that. I'd be greatly appreciated.
    Thanks,
    Bank

    Bank,
    This is a problem, that needs to be addressed in PE. You need to work with Project settings (presets), that match your Assets, and then Export to DV-AVI (or DVD-MPEG2). Encore will not be able to edit the image/Video size. Only feed it DVD-compliant Assets.
    Hunt

  • How to increase the alert field size?

    Hi Experts,
        In Adapter Error Description , i am tryin to get the entire error through mail/In Alert Inbox ......I hav changed the data type from Char70 to Char512 which is there in XI server abap stack. But I cannot get an error in alert inbos or my gmail account more than approx 83-85 charecters!!
    I know due to technical restrictions between the Workflow Container and SAPscript,only the first 80 characters of a container element are taken into account, when the variables are replaced during runtime, But experts, any special techniques!!!
    Regards,
    Arnab

    Hi,
    Here is a thread but with negative answer. check if it helps
    Alert: to increase the field length
    Thanks!

  • How do increase the file system size

    Hi friends,
    My newly installed solaris 10 system shows Filesysem full error.
    By mistake space allocated for Root is very less and 98% of the space in Root is consumed.
    Do i need to restructure entire filesystem or increase space in Root would be sufficient..?
    Its 160 GB Harddisk on Intel Core 2 duo. What is the best allocation for the same.
    I am very new to Solaris. Trying to learn how does Opensource OS works...
    Pls help me
    Regards
    Bijoy

    If you have more drive space you can mount more space and allocate it to a mount point--this may take care of your problem, but if you are out of space and you are not buying any more drives.... then it's time for the install disks to come back out and configure more appropriately to your use.
    I have my work machine at home on a x64 AMD with 120 GB of drive. I gave 40 GB to Solaris just to be sure I could do basic installations and grow a little.
    Once your allocation is full you have 2 options... buy more and mount it, or reinstall... you choose.
    Well, there is a 3rd... you could unmount one of the other allocations and split it, then mount some of it back to your OS and some back to what it was before, but you are going to be plagued with this your entire lifetime of that install.

  • How i increase the font text size.......

    fullPreloader.onLoadComplete = function(target)
            new Tween(target, "_alpha", Strong.easeOut, 0, 100, .5, true);
            target.my_txt.text = myTitle;
            target.my_txt._y=10;
            target.my_txt.size=90;                       // its not working
            target.my_txt.textColor = 0xffffff;
            target.my_txt.selectable=false;
            nickey.text = myDesc;

    Look into using the TextFormat class for contrling the appearance of the text in the textfield...
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.size = 90;
    my_fmt.color = 0xffffff;
    target.my_txt.setTextFormat(my_fmt);

  • How to increase the alv grid size dynamically

    Hi all,
    I have to develop the report with the following requirement:
    I have to take bwkey from t001k on basis of bukrs and bwkey. this bukrs and bwkey are entered in selection-screen.
    I have to select matnr, lbkum, salk3 from mbew on basis of bwkey in selection-screen.(this is select options)
    now the ouput should be as follows:
    for example :
                        ef01                efo2               ef03
    matnr     lbkum  salk3  lbkum    salk3      lbkum  salk3         total
    700001     3       4            0        0            0            0                    7
    700010     0       0            2       1             0            0                    3
    The output should be as mentioned above.
    In the above output,
    in the first record for 700001, the total of 3 and 4 is displayed as total 7 and
    for 700010 , it is displayed as 3.
    the get the output as above in the alv grid,
    I have taken bwkeys in t001k and remaining fields from mbew and joined them in final internal table.
    now in the final table ifinal, i have the following fields,
    matnr lbkum salk3 bwkey total.
    now when i want to display the output, it is displaying as normal output like
    mantr bwkey lbkum salk3 total
    700001 etap   3         4      7
    700002 etap   1        2       3
    but i want to display in the first mentioned format.
    so i tried to attach the bwkey values in it001k(this is internal table for t001k) for the final field catalog so that this bwkeys are displayed as column headings in the final output. but it is not displaying.
    Please suggest me the solution to display the output in the above first mentioned
    format as soon as possible
    points will be awarded.
    thanking u in advance.
    A.Srinivas

    hi ,
    u can set the row count to any number , here I am setting it to 5 using the method set_visible_row_count
    1 Change the visible row count to u20185u2019
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      DATA lo_interfacecontroller TYPE REF TO iwci_salv_wd_table .
      lo_interfacecontroller =   wd_this->wd_cpifc_alv( ).
        DATA lo_value TYPE REF TO cl_salv_wd_config_table.
        lo_value = lo_interfacecontroller->get_model(
        lo_value->if_salv_wd_table_settings~set_visible_row_count( '5' ).
    u can also go thru this useful links for CONFIGUIRING ALV :
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40794172-b95a-2910-fb98-b86d8a0918b4;jsessionid=(J2EE3417400)ID0488867050DB10849380333905377829End
    SAP List Viewer (ALV) [original link is broken]
    Configuring ALV
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1190424a-0801-0010-84b5-ef03fd2d33d9?overridelayout=true
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/db22242d-0701-0010-28a2-aeaa1fefd706;jsessionid=(J2EE3414800)ID0133346050DB00727847586176044227End?overridelayout=true&bcsi_scan_06B6B0A4B65849C2=0
    I hope it shud solve ur query.
    regards,
    amit

  • 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

Maybe you are looking for

  • Some Music Not Showing Up In Cloud

    I have an iMac.  I recently purchased an iMatch account.  I can't get the music that I've imported from cd's to load in the iCloud, only my iTunes purchased music is showing up in the cloud.  Is there a simple step I'm missing?   Thanks.

  • Error while connecting to external server through SOAP/HTTP adapter

    Hi, we are trying to connect to the external server through SOAP adapter. The scenario is proxy to SOAP asynchronous scenario. We are getting following error in Communication channel monitoring: *Message processing failed. Cause: com.sap.aii.af.ra.ms

  • Events entered in iPad calendar not in iPhone cal

    Events entered in iPad calendar not in iPhone cal

  • Buttton and refresh problems

    Hi!!! When I refresh a mainpage from a popuppage by javaScript, if a mainpage has a button, this button is clicked automatically and button_action() function executed. I don't want to do this automatically. Why happened this?? How can I resolve this

  • Zero priced components missing!!!

    Hello guys, I have recently purchased a Cisco 5596 Nexus switches,  6248UP fiber interconnect and Cisco UCS chassis including the Blade servers  for Cisco UCS implementation. When I placed the order to buy the  equipments, I have included these zero