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.
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.
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.
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.
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.