Results 1 to 4 of 4
  1. #1
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Default java.lang.OutOfMemoryError:Java heap space

    Hello All,

    could any body please help.. why I am getting below error message
    what should I check?


    Exception in thread "Thread-10" java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:2882)
    at java.lang.AbstractStringBuilder.expandCapacity(Abs tractStringBuilder.java:100)
    at java.lang.AbstractStringBuilder.append(AbstractStr ingBuilder.java:390)
    at java.lang.StringBuilder.append(StringBuilder.java: 119)
    at java.lang.Throwable.toString(Throwable.java:344)
    at commanywhere.Class1.getHostId(Class1.java:203)
    at commanywhere.JFrmRatePulse.insertACODE(JFrmRatePul se.java:348)
    at commanywhere.JFrmRatePulse.access$700(JFrmRatePuls e.java:29)
    at commanywhere.JFrmRatePulse$6.run(JFrmRatePulse.jav a:493) at commanywhere.JFrmRatePulse$6.run(JFrmRatePulse.jav a:493)
    at java.lang.Thread.run(Thread.java:619)


    and sometimes .. I got below error:

    Exception in thread "AWT-EventQueue-0" Exception in thread "Thread-11" java.lang.OutOfMemoryError: Java heap space
    java.lang.OutOfMemoryError: Java heap space
    at sun.java2d.ScreenUpdateManager.createGraphics(Scre enUpdateManager.java:45)
    at sun.java2d.d3d.D3DScreenUpdateManager.createGraphi cs(D3DScreenUpdateManager.java:263)
    at sun.awt.windows.WComponentPeer.getGraphics(WCompon entPeer.java:555) at sun.awt.windows.WComponentPeer.getGraphics(WCompon entPeer.java:555)
    Last edited by newbiejava; 08-22-2010 at 06:57 AM.

  2. #2
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Location
    Destiny Islands
    Posts
    692
    Rep Power
    10

    Default

    Without seeing the code you've designed erroneously (which appears to be Class1.java, line 203), my best guess is that you've tried to create an array with a size larger than the RAM will allow you to.

    If you're looking for a place to check in a stack, the first place to look (in my experience) is at the highest "at" line that is your own file--in this case, Class1.java:203.

  3. #3
    newbiejava is offline Senior Member
    Join Date
    Jan 2010
    Posts
    138
    Rep Power
    0

    Default

    Hi.. but I also got different error message below:

    Exception in thread "AWT-EventQueue-0" Exception in thread "Thread-11" java.lang.OutOfMemoryError: Java heap space
    java.lang.OutOfMemoryError: Java heap space
    at sun.java2d.ScreenUpdateManager.createGraphics(Scre enUpdateManager.java:45)
    at sun.java2d.d3d.D3DScreenUpdateManager.createGraphi cs(D3DScreenUpdateManager.java:263)
    at sun.awt.windows.WComponentPeer.getGraphics(WCompon entPeer.java:555) at sun.awt.windows.WComponentPeer.getGraphics(WCompon entPeer.java:555)

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default

    Quote Originally Posted by newbiejava View Post
    Hi.. but I also got different error message below:
    That could've been caused by the same StringBuilder eating up (nearly) all the memory; when something else needs a bit of memory and it isn't available the same OutOfMemory error is thrown.

    kind regards,

    Jos

Similar Threads

  1. Replies: 5
    Last Post: 08-13-2010, 10:04 AM
  2. java.lang.OutOfMemoryError: Java heap space
    By paul in forum Advanced Java
    Replies: 11
    Last Post: 06-12-2010, 05:30 PM
  3. Replies: 10
    Last Post: 05-11-2009, 11:56 AM
  4. Replies: 3
    Last Post: 04-22-2009, 08:25 PM
  5. java.lang.OutOfMemoryError: Java heap space
    By vidjogamer in forum New To Java
    Replies: 3
    Last Post: 02-06-2009, 06:52 AM

Posting Permissions

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