what is an Error in Java Program.How to handle OutOfMemory Error in Java program ?
Example : My web application is crashing due to OutOfMemory Error how to handle it in your java program.?
Regards, Rene Larsen
According to Java 1.5 API:Error is a sub class of throwable that indicates serious problems that a reasonable application should not try to catch,hence we conclude that we should not catch Error in our program..
but how do i handle this Error in my Java program.
My jsp file is containing Approximately 35000 lines of code
Originally posted by Deepak Lal:
Rene Larsen,You were mentioning about JVM parameters,Can you elaborate more on that.?
rlarsen:~ rlarsen$ java -X
-Xmixed mixed mode execution (default)
-Xint interpreted mode execution only
-Xbootclasspath:<directories and zip/jar files separated by :>
set search path for bootstrap classes and resources
-Xbootclasspath/a:<directories and zip/jar files separated by :>
append to end of bootstrap class path
-Xbootclasspath/p:<directories and zip/jar files separated by :>
prepend in front of bootstrap class path
-Xnoclassgc disable class garbage collection
-Xloggc:<file> log GC status to a file with time stamps
-Xbatch disable background compilation
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
-Xprof output cpu profiling data
-Xfuture enable strictest checks, anticipating future default
-Xrs reduce use of OS signals by Java/VM (see documentation)
-Xdock:name=<application name>
override default application name displayed in dock
-Xdock:icon=<path to icon file>
override default icon displayed in dock
-Xcheck:jni perform additional checks for JNI functions
-Xshareff do not attempt to use shared class data
-Xshare:auto use shared class data if possible (default)
-Xsharen require using shared class data, otherwise fail.
The -X options are non-standard and subject to change without notice.
rlarsen:~ rlarsen$
Regards, Rene Larsen
Regards, Rene Larsen
Originally posted by Rene Larsen:
Which Application Server do you use and what OS do you use??
Campbell wrote: Question 1: If I were marking I would mark you down for the spelling errors in the interface names, but the real problem is that many people would now prefer to use annotations rather than marker interfaces.
My Comments for Question 1: I'm new to annotations.How Should i proceed to write annotations instead of marker interfaces.Can you please give me a sample example with respect to Java 1.5 API.?
Campbell wrote: Question 2:Rene Larsen, has already given you a suggestion about what changes to make. We don't know what's in your configuration file, so we can't help any more there.
My Comments for Question 2: Rene mentioned about a configuration file for JBOSS Server,so i wanted to know which configuration file needs to have the VM paramters set in case of TOMCAT SERVER V5.5 and BEA Weblogic Server.?
Can you tell me what changes has to be made in the configuration file.?
Campbell wrote :Question 4: It's Throwable not throwable. You ought to have closed your fileInput object in the same method it was created in (and in a finally). You ought only to use finalize() to close native resources, and I think (but may be mistaken) you ought to start with super.finalize();.
My Comments for Question 4:sorry for making mistakes with Throwable,
I'm new to using finalize() method in java.Can you please tell me what do you mean by native resources.Can you please provide me with a sample Java example for finalize() method where you are closing native resources.?
Finally Campbell wrote:
In fact I think all 4 questions you quoted have something wrong with them; maybe you ought not to create marker interfaces, you oughtn't to handle Errors, you can't assign a String to a StringBuilder, and you oughtn't to use finalize() for Java code.
My comments for the above interpretation:
1>You ought not to create marker interfaces? --> what's wrong with this?
2>you oughtn't to handle Errors -->Strongly agree with you.go by the Error(Java 1.5 API definition)
3>you can't assign a String to a StringBuilder -- very Much true.
4>you oughtn't to use finalize() for Java code --> then why do we have finalize() method in Java?Please explain.?
Regards, Rene Larsen
Originally posted by Campbell Ritchie:
Question 1: If I were marking I would mark you down for the spelling errors in the interface names, but the real problem is that many people would now prefer to use annotations rather than marker interfaces.
Joanne
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|