Results 1 to 6 of 6

Thread: Error Java.lang.OutOfMemoryError

  1. #1
    Join Date
    Dec 2009
    Posts
    211

    Error Java.lang.OutOfMemoryError

    Hello,
    I am currently trying out a program that J2EE has to compare the strings of a table A with those of Table B through the hamming algorithm. The principle is that I load a table in a HashSet and table B in another. When I was content titles and numbers all went well, although as you can imagine it was very long. But now the problem is that I am getting any exception
    Code:
    Java.lang.OutOfMemoryError
    I have no idea of how to eliminate this error problem my code, any help is appreciated. Thanks in advance.

  2. #2
    Join Date
    Nov 2009
    Posts
    356

    Re: memory heap error

    Hello,
    You can already try to increase the memory allocated to the JVM. In your startup.bat your tomcat, you put the following line:
    Code:
    set JAVA_OPTS =% JAVA_OPTS%-Xms256m-Xmx1024m
    What allocate 1GB to your JVM. Restart tomcat and try again. I think this solution for work for you. First try this and if it does not then post back with the error you are getting.

  3. #3
    Join Date
    Dec 2009
    Posts
    192

    Re: Error Java.lang.OutOfMemoryError

    Hello,
    Even I have a similar kind of a error in my code and do not have a solution for this. The sizes of tables currently sticking with the minimum that will be in prod. And the customer does not buy the latest supercomputer from NEC. I hope you are getting what I am trying to explain here. I would like your opinion about that: Do not push the issue? Also 1GB of RAM is what I have on my test server.

  4. #4
    Join Date
    Nov 2009
    Posts
    347

    Re: Error Java.lang.OutOfMemoryError

    Hello,
    In my opinion, you need enough memory to store your HashSet, so you're forced to have enough RAM for the JVM. Now, if you need as much memory as it is only a "small" basis is that you see your program. Try to load a portion of the base, then the next. It should go faster also. I hope this solution will solve your problem and you will find a proper way to code.

  5. #5
    Join Date
    Dec 2009
    Posts
    211

    Re: Error Java.lang.OutOfMemoryError

    Hello,
    Yes that's what I think to do: load the base batch. But I have a doubt about that. Do I re-creates a connection to each change of lot or do I let the first open throughout the duration of treatment? If you have any idea about this, then please let me know also if you have any alternative solution for this then I am the interested one. Thanks in advance.

  6. #6
    Join Date
    Nov 2009
    Posts
    359

    Re: Error Java.lang.OutOfMemoryError

    Hello,
    If you're the only one to use this base to the limit you can leave the connection open. But if not, or if you go about connecting all 30 minutes (longer intervals), you can close it. Basically there must avoid thee reconnect every 5 seconds, this may even solve your problem. I think it is hard to guess just from the conversations going on, I think practically it would be something different there.

Similar Threads

  1. Replies: 5
    Last Post: 27-08-2011, 10:36 PM
  2. Replies: 5
    Last Post: 15-12-2010, 07:18 PM
  3. Error - java.lang.NumberFormatException
    By Vodka in forum Software Development
    Replies: 5
    Last Post: 05-03-2010, 11:57 AM
  4. Error message: Uncaught Exception java.lang.error
    By Rum in forum Portable Devices
    Replies: 5
    Last Post: 06-01-2010, 01:59 PM
  5. Java.lang.OutofMemory.Exception error
    By Unnat in forum Software Development
    Replies: 3
    Last Post: 07-05-2009, 11:23 AM

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,715,736,345.52631 seconds with 16 queries