Results 1 to 4 of 4

Thread: Java.lang.OutofMemory.Exception error

  1. #1
    Join Date
    Jan 2009
    Posts
    84

    Java.lang.OutofMemory.Exception error

    Hey Guys,

    Recently i was trying to convert a file to my mysql database. When i was trying to convert the file which was around 150 mb in size, it showed me an error message that "Java.lang.Out of Memory.Exception" on my desktop screen. I don't but its not allowing me to convert that particular file to my mysql database. Can any body help me out to get rid of the above problem? Any kind of help on the above issue would be appreciated.

    Thanks.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Java.lang.OutofMemory.Exception error

    The JVM places an upper limit on the amount of memory available to the current process in order to prevent runaway processes gobbling system resources and making the machine grind to a halt. When reading or writing large spreadsheets, the JVM may require more memory than has been allocated to the JVM by default.This normally manifests itself as a java.lang.OutOfMemory exception. By default, each workbook allocates 5MB when created and allocates more memory in 5MB increments. These values can be changed by using class WorkbookSettings. Often the OutOfMemory exception can be removed by lowering these values (note that performance may suffer as a result). Alternatively, you can allocate more memory to the JVM using the -Xms and -Xmx options; e.g., to allocate an initial heap size of 10 MB, with 100 MB as the upper bound, you should start the JVM like this:java -Xms10m -Xmx100m MyClass In order to allocate more memory in this manner to servlets/JSPs, consult the help documentation for the Web Application Server.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    Re: Java.lang.OutofMemory.Exception error

    Hey you can try have a look at your code, there could be a memory leek. Try to set variables to null, after sometime it will clear the memory. You can also look out for some loops in you code, which may also consume a lot of memory.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Re: Java.lang.OutofMemory.Exception error

    Most JVMs allocate memory on the heap for almost everything, except for reflective data. That is put in a separate location which is a section of the heap that is reserved for permanent generation. This gets easily filled up when you dynamically load an unload classes, or have a large number of classes. I simply added the following options to the java executable and all my worries were gone:-
    -XX: PermSize=256M -XX:MaxPermSize=256M
    My entire command for Sun's JVM looks like this now:-
    java -server -Djava.awt.headless=true -Xms1024M -Xmx1024M
    -XX: PermSize=256M -XX:MaxPermSize=256M
    Hope so it may help you out to resolve the problem.

Similar Threads

  1. Replies: 3
    Last Post: 19-02-2011, 03:20 AM
  2. Replies: 5
    Last Post: 20-10-2010, 12:44 AM
  3. Replies: 4
    Last Post: 08-04-2010, 12:37 PM
  4. Error - java.lang.NumberFormatException
    By Vodka in forum Software Development
    Replies: 5
    Last Post: 05-03-2010, 11:57 AM
  5. Error message: Uncaught Exception java.lang.error
    By Rum in forum Portable Devices
    Replies: 5
    Last Post: 06-01-2010, 01:59 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,660,344.07838 seconds with 17 queries