Results 1 to 14 of 14
  1. #1
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default How do I increase java memory in windows 7?

    I am doing some math with a couple very large arrays and I get this java.lang.OutOfMemoryError: Java heap space

    I need about 200MB of ram for this program, and of course the java defaults are just under that!

    I tried adding -Xmx1g or 512m using the command line and the java control panel in the windows control panel, and it does not work. The computer itself has 4gb, so that should not be an issue.

    Any help would be nice.

    Thanks!

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: How do I increase java memory in windows 7?

    What does "it does not work" mean?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?

    java.lang.OutOfMemoryError: Java heap still occurs, even though I added -Xmx1g to the windows control panel java controler

    in the command line it does not let me change anything, returning "improper name" when I try.

  4. #4
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?

    Also this is an applet that runs when compiled in netbeans

  5. #5
    endotherm is offline Member
    Join Date
    Mar 2012
    Posts
    9
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?


  6. #6
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?

    I already looked through that page. Thanks though. I get none of those errors. I wish it was that easy!

  7. #7
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?

    Still looking around... this is an applet running through netbeans, so I went to project properties>run>VM options and put in -Xmx512m -Xms512m... and of course that did not work. Still getting "java.lang.OutOfMemoryError: Java heap space". Also the line it fails on is defining one of the large arrays...
    Last edited by Masherbrum; 03-03-2012 at 09:20 AM.

  8. #8
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: How do I increase java memory in windows 7?

    How did you compute the memory requirement?

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  9. #9
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?

    Both experimentally: by varying the array size to see what works and what does not, and theoretically: simply multiplying out the array size*number of arrays*variable size. Both are similar, and what I need is just over the 128m default. Of course its just over! Why wouldnt it be!

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: How do I increase java memory in windows 7?

    I have no idea how applets are run in Netbeans.
    It is possible (in Java 6+ I believe) to set the heap size for an applet in its applet tag.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?

    Thanks, but the applet tag is for running from within a web browser. I am trying to run from the netbeans IDE, as I still have some code modifications to make as I scale up the dataset to its full size. Theres a window within netbeans where someone else told me to type in the -Xmx512m thing, but that does nothing. Also when I add -Xmx512m to the java control panel, as shown in this video linked below, there is no change and I still get the heap space error on the same line as before.

    Increase the java heap space for browser applets - YouTube

    Thanks

  12. #12
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: How do I increase java memory in windows 7?

    Is there a particular reason you're using an applet for this?
    If it were a desktop app then you'd be able to control the memory of the JVM a lot easier.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  13. #13
    Masherbrum is offline Member
    Join Date
    Feb 2012
    Posts
    13
    Rep Power
    0

    Default Re: How do I increase java memory in windows 7?

    Hmmmm, no, not really. No good reason for any program vs any other. I guess I just randomly picked that the first time I used Java and that was what I was using. I thought the heap size affected desktop applications the same as applets? Maybe not? Anyway, i'll give it a try, once this hell week at work is over. Basic functions like mouseclicks and drawing rectangles should work the same, right?

    Thanks

  14. #14
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,817
    Rep Power
    19

    Default Re: How do I increase java memory in windows 7?

    Well, I don't know how good the applet viewer stuff is, and I know you can control the runtime configurations in the likes of Netbeans really easily (simply adding an Xmx in the command parameters).
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. How to increase Memory to java runtime process
    By gianpiero.guerrera82 in forum Advanced Java
    Replies: 0
    Last Post: 10-31-2011, 10:37 AM
  2. Replies: 1
    Last Post: 07-18-2011, 04:24 PM
  3. Windows java vs Windows AIX
    By sysp in forum New To Java
    Replies: 0
    Last Post: 01-26-2011, 05:32 AM
  4. Replies: 2
    Last Post: 08-21-2008, 07:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •