This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi All, I am having a java program which is running on a UNiX Machine and giving JVM Out Of memory error.This program accesses database and read some data (CLOB and BLOB on DB2 UDB..no need to bother about this ).As the data size is more than 9MB it is failing to allocate so much memory and giving the Out Of memory Exception. I am thinking that if we change the JVM heap size or the Memory allocated to the Process then the problem will be resolved. How do change the Heap Size? I have refered some documents in web saying that we can heap size in the from comman prompt when we invoke the JVM by passing the JAVA_ARGS="-Xms64m -Xmx96m" argument Does it mean like below? java <ClassName> JAVA_ARGS="-Xms64m -Xmx96m" (assuming there is no jvm running already) I don't need to set the Heap size programatically.But I am not finding this java Args option anywhere in my jre bin ir lib directories.. Some documents mentioned that we can modify jvm.config file but I don't find any document named by that. Could you please advice me where and how to change this parameter or how do I solve this problem?? Thanks in Advance
Praveen<br />Sun Certified Programmer for Java 2 Platform.
Are you getting the OutOfMemoryError during the startup or after some days from the day of starting? If it is during startup then the big heap size will help to solve your problem. Otherwise I assume that your program is having memory leak. better to profile your code using some profilers.
Praveen K Pippiri
Joined: Jun 17, 2002
I can't imagine how did I make such a silly mistake.. So far I was using java <classname> <reqdargs> I don't know why I was making this mistake.Now I interchanged the arguments. I tested in a sample program and it is allocating the reqd memory.Let me Test my application. I want to know about the profilers.What is this??Can you tell me where will I get more info on this?? Thanks a lot for your adivce.
Joined: Feb 28, 2003
Profiler(like OptimizeIt) helps you to find out the memory leaks in your application. With that you can find out the dead-locks if your appln. if it is a multithreaded one. You can try with the evaluation copy of OptimizeIt downloadable at the borland web site
Praveen K Pippiri wrote:I can't imagine how did I make such a silly mistake..
So far I was using java <classname> <reqdargs>
I don't know why I was making this mistake.Now I interchanged the arguments.
I tested in a sample program and it is allocating the reqd memory.Let me Test my application.
I want to know about the profilers.What is this??Can you tell me where will
I get more info on this??
Thanks a lot for your adivce.
Hi Praveen ,
I am facing the same exception.
I did java -Xmx300m Input
Input is the class name.
But everytime I run this comand in cmd prompt, I get No Class Def Found Error.
I am first going to the directory of this particular class and then running the command.
Joined: Mar 24, 2008
I am fetching a Clob column from DB through Java programming.
I am just assigning the clob data to a string object and have to do some string manipulations to get the XML data of the Clob.
Then i am writing those manipulated values to an excel sheet.
Here the issue is with the clob data.
I am unable to fetch for more than 4000 records from clob column and write to excel.
Every time it throws me Java Heap Space: Out of memory exception.
I had tried modifying my code and then reached to 4000 records.
Please let me know how to use the cmd prompt options, because everytime I use this option I am getting No Clas def Found Error.
My target is to fetch 10000 records and write to excel sheet.
Joined: Mar 24, 2008
I am using jre 1.6 and RAM is 1.87 GB.
Can anyone let me know whats the exact cmd prompt statement which i should use or any other work around for this issue?
Don't worry about the memory for now - focus on the NoClassDefFoundError. Is it the "Input" class that is causing the problems, or another class? How are you executing your class when you get the OutOfMemoryError?