Results 1 to 13 of 13

Thread: Heap memory

  1. #1
    gayathri_g is offline Member
    Join Date
    Aug 2009
    Posts
    9
    Rep Power
    0

    Default Heap memory

    do any one know how to increase the JVM memory space for applet?
    please help me.I'm getting Heap memory exception.

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Java Control Panel

    See the part labeled "Java Applet Runtime Settings", and pay attention to the subpart labeled "Java Runtime Parameters" and then see java - the Java application launcher to determine what parameters to set


    Java Deployment Guide

    Edit: Which means, of course, that the developer has no control over it. The only thing you can do is to provide instructions to the user, but the client must change their settings, the Applet, itself, has no control over it.
    Last edited by masijade; 09-08-2009 at 08:33 AM.

  3. #3
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    This won't help for an applet thats embedded in a web page, but if you happen to be using an applet (or any java app) locally, you can increase the heap size at launch time in the command line like this:
    Java Code:
    java -Xms128m -Xmx256m MyJavaClassFile
    which will increase the minimum JVM memory to 128MB and the max to 256MB. If you are using an applet as a quick and dirty gui shell for a program, this will work just fine.

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    9

    Default

    Quote Originally Posted by quad64bit View Post
    This won't help for an applet thats embedded in a web page, but if you happen to be using an applet (or any java app) locally, you can increase the heap size at launch time in the command line like this:
    Java Code:
    java -Xms128m -Xmx256m MyJavaClassFile
    which will increase the minimum JVM memory to 128MB and the max to 256MB. If you are using an applet as a quick and dirty gui shell for a program, this will work just fine.
    Did you read the post above? This is what he needs to do, but through the control panel, as outlined in the links above.

  5. #5
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    Did you READ my post? You can run applets without ever touch a webpage.
    do any one know how to increase the JVM memory space for applet?
    please help me.I'm getting Heap memory exception.
    Where does the OP say the applet is running embedded in a web page? At my last university there was a class taught that used applets for everything because it reduces the complexity of drawing images to the screen, yet none were executed from a web page-- all run locally. Java classes can extend Applet and still run as local java applications.

  6. #6
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    Edit -- sorry masijade , I think I mis-read your post, sorry for sounding snotty.

    I was simply saying that you can set your mem sizes at launch time for specific applets as needed, rather than letting java eat tons of ram all the time. I leave my JVM at the default settings and only increases as needed, specific to each app.

  7. #7
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Quote Originally Posted by quad64bit View Post
    ... At my last university there was a class taught that used applets for everything because it reduces the complexity of drawing images to the screen, ...
    How do applets do that?
    By "everything" you mean that the GUI related projects that did involved drawing an image to the screen?

  8. #8
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    Yes, gui related apps-- it was a concepts object oriented design class that was designed to show the relationships between objects -- usually shapes, etc.. That doesn't really matter.

    But, by extending Applet, you can use it's methods for things -- often an application will use the Applet's sound loading/playback functionality for a quick and dirty sound effects, or in the days before ImageIO you could use Applet's canvas and image loading capability.

  9. #9
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    [QUOTE=quad64bit;81543]...

    But, by extending Applet, you can use it's methods for things -- often an application will use the Applet's sound loading/playback functionality for a quick and dirty sound effects, or in the days before ImageIO you could use Applet's canvas and image loading capability.[/QUOTE
    Which sound loading/playback functionality? The one I think you are talking about has nothing to do with Applets and is just a static method which can be called from any type of application. But you could be talking about something else so I'll let you confirm that.

    You also haven't specified how loading images in Applets is (or was) easier than in normal Swing applications.

  10. #10
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    7

    Default

    I don't know why you're grilling me man; We're getting way off topic here. I'm sorry I demonstrated how to increase memory at launch time, If its helpful, I could go back and delete my posts.

  11. #11
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    Grilling? You stated that applets "reduces the complexity of drawing images to the screen".
    So I asked you to explain what you meant by that.
    Why would you want to delete your post? Was it wrong?

  12. #12
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default

    I think he was saying he could delete the posts if it was confusing the OP. And yes, it does sound like you're grilling him.

    OP: Just ignore everything but the first few posts.

  13. #13
    r035198x is offline Senior Member
    Join Date
    Aug 2009
    Posts
    2,388
    Rep Power
    7

    Default

    No I'm not grilling him. I'm trying to understand what he meant by his statement.
    If he can't back it up with a reasonable explanation then he is misinforming people and that is what I'm trying to stop.

Similar Threads

  1. JVm Heap memory settings
    By nagesh in forum Advanced Java
    Replies: 2
    Last Post: 09-17-2009, 05:47 PM
  2. [SOLVED] JVM: Heap out of memory
    By jwilley44 in forum Eclipse
    Replies: 7
    Last Post: 02-01-2009, 04:13 PM
  3. Replies: 2
    Last Post: 08-21-2008, 07:33 PM
  4. JVM Heap memory settings
    By nagesh in forum New To Java
    Replies: 1
    Last Post: 08-11-2007, 10:17 PM
  5. Java Heap Out of Memory Error
    By stonkers in forum New To Java
    Replies: 3
    Last Post: 07-17-2007, 04:43 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
  •