Sie sind auf Seite 1von 6

The heap size influences the following:

The GC frequency and the pause during collections


The number of short and long term objects
Fragmentation and locality problems
An undersized heap with the concurrent collector leads to full GCs with an increase in load and also fragmentation
problems.
An oversized heap leads to increased collection times and locality problems (smear problem).
The permanent generation may be a factor on applications that dynamically generate and load many classes (JSP
and CFM application servers).
Size the heap to handle peak and burst loads.
Be sure to increase the memory as you increase the number of processors, since allocation can be parallelized.
Configure as much memory as possible to the virtual machine unless you have problems with pauses.
Do not choose a maximum value for the heap unless you know that the heap is greater than the default maximum
heap size.
Explicit garbage collection calls (System.gc ()) force a major collection.
Measure the effectiveness of explicit GC calls by disabling them using the following option:
-XX:+DisableExplicitGC
Increase the MaxPermSize to accommodate the dynamically generated classes.
-XX: MaxPermSize=nnn
Use -XX:+AggressiveHeap for throughput applications.
Applications that rely on finalization (finalize method) will cause lag in garbage collection. Try reducing the
dependency on finalization.
The more CPUs, the more the advantages of the concurrent collector increase.
The increase in the lifetime of objects increases the frequency of collection as live objects take heap space. So keep
live objects to the needed minimum.
Set a limit for pooled objects and do not set this value too high.
Avoid setting old generation size too small as this may result in undersized heaps.
An undersized heap may reduce collection time and lead to fragmentation and frequent full GCs.
Increase young generation to decrease the frequency of collection, but this will increase pause. So choose a size for
the young generation where the pause is tolerable.
An increase in load will fill up the heap faster and this will increase the collection frequency. To reduce the collection
frequency, increase the heap size.
Use the default serial collector for smaller applications.
For larger applications hosted on WebLogic Server, use the throughput collector.
-XX:+UseParallelGC
Use -Xconcgc for low pause applications.
Use Intimate Shared Memory (ISM) and variable page sizes to reduce the smear problem where available.
-XX:+UseISM




When the memory is insufficient for a deployed application, a java.lang.OutOfMemoryError is thrown. There will
be different error messages for OutOfMemoryErrors in each type of memory. The Java Virtual Machine (JVM) has
the following types of memory:
Heap memory is the runtime data area from which memory for all class instances and arrays is allocated. When an
application creates a new object but the heap does not have sufficient space and cannot be expanded further, an
OutOfMemoryError will be thrown with the following error message: java.lang.OutOfMemoryError: Java heap
space

Non-heap memory includes the method area and memory required for the internal processing or optimization of
the JVM. It stores per-class structures such as a runtime constant pool, field and method data, and the code for
methods and constructors. When the permanent generation is full, the application will fail to load a class or to
allocate an interned string, and an OutOfMemoryError will be thrown with the following error message:
java.lang.OutOfMemoryError: PermGen space

Native memory is the virtual memory managed by the operating system. The Java Native Interface (JNI) code or
the native library of an application and the JVM implementation allocate memory from the native heap. An
OutOfMemoryError will be thrown when an allocation in the native heap fails. For example, the following error
message indicates insufficient swap space, which could be caused by a configuration issue in the operating system or
by another process in the system that is consuming much of the memory:
java.lang.OutOfMemoryError: request bytes for .
Out of swap space?
An insufficient memory problem could be due
Either to a problem with the configuration ie the application really needs that much memory. Increase the heap size
Or to a performance problem in the application that requires we to profile and optimize to reduce the memory use.
Memory leaks:
The JVM is responsible for automatic memory management, which reclaims the unused memory for the application.
However, if an application keeps a reference to an object that it no longer needs, the object cannot be garbage
collected and will occupy space in the heap until the object is removed. Such unintentional object retention is
referred to as a memory leak. If the application leaks large amounts of memory, it will eventually run out of memory,
and an OutOfMemoryError will be thrown.


Read more: http://www.wikiconsole.com/wiki/?tag=weblogic-realtime#ixzz2OL4tW0Gz

Solution for Memory Issue:
Trigger the Garbage collection from Admin console, restart the server if GC doesnt help


Read more: http://www.wikiconsole.com/wiki/?tag=weblogic-realtime#ixzz2OL4xgoyJ

java.lang.OutOfMemoryError: GC overhead limit exceeded" exception with
Sun JDK 1.6
by admin under Realtime Issues, WebLogic Server
<Error> <Kernel> <BEA-000802> <ExecuteRequest failed
java.lang.OutOfMemoryError: GC overhead limit exceeded.
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.<init>(String.java:216)
at java.lang.StringBuilder.toString(StringBuilder.java:430)
at weblogic.servlet.internal.ServletRequestImpl.toString(ServletRequestImpl.java:243)
at java.lang.String.valueOf(String.java:2827)
Truncated. see log file for complete stacktrace
Cause
The java.lang.OutOfMemoryError: GC overhead limit exceeded message means that for some reason the garbage
collector is taking an excessive amount of time.
The parallel collector will throw an OutOfMemoryError if too much time is being spent in garbage collection: if more
than 98% of the total time is spent in garbage collection or less than 2% of the heap is recovered by garbage collection,
an OutOfMemoryError will be thrown.
This feature of throwing GC overhead limit exceeded message is designed to prevent applications from running for
an extended period of time while making little or no progress because the heap is too small.
Solution
You can avoid the above java.lang.OutOfMemoryError: GC overhead limit exceeded exception by disabling the GC
overhead limit feature in Sun JDK 1.6 by adding the following argument to the start script of JVM:
-XX:-UseGCOverheadLimit
However, please note that disabling the overhead limit only avoids getting the OutOfMemoryError at an early stage.
The OutOfMemoryError is very likely to be thrown at a later stage, because it does not remove the underlying
problem. You should still look into your application and JVM settings to find the cause of GC taking an excessively
long time.


Read more: http://www.wikiconsole.com/wiki/?tag=weblogic-realtime#ixzz2OL59BUK8

ORACLE JRockit and Stack Overflow Troubleshooting
by admin under Realtime Issues, WebLogic Server
First of all, a StackOverflowError is an instance of a JVM Error, and from the very reference of the
java.lang.StackOverflowError , a JVM might not be able to survive when this condition happens.
You might thus discover the Stack Overflow condition in your production application from either repeating core
dumping, and/or alert in your application logs (typically, a StackOverflowError appears in the application logs)
WHAT TO DO
When an ORACLE JRockit Java Virtual Machine dies unexpectedly, it attempts to create a short text file, named
jrockit.<pid>.dump, by default in the directory from which the JVM was started (working directory). Then, the
Operating System will create a core file on UniX/LinuX, and minidump on Windows.
This text file (jrockit.<pid>.dump) can be easily viewed in any text editor, and the number of StackOverflowError that
happened before the JVM died is displayed conveniently in the file.
In addition, at the end of the crash report, provided the JVM died because of the StackOverflowError, the whole stack
trace (which can be extremely long) appears.
In case the StackOverflowError appears in the application log, and the JVM survives this condition, and the stack
trace is not showing up in the logs, a specific verbosity tool can be turned on inside the JVM to report this condition:
R27: $JROCKIT_HOME/bin/jrcmd <pid_of_target_JVM> verbosity
set=stackoverflow=debug
R28: $JROCKIT_HOME/bin/jrcmd <pid_of_target_JVM> verbosity
set=exceptions=info
After this command has been issued, when a Stack Overflow condition happens, the stack of the offending code path
is displayed in the stderr of the target JVM.
You can redirect the output using the specific optional argument to the command above
filename=<full_path_name_to_target_log>
The Xverbose:stackoverflow module was removed in R28. Instead Xverbose:exceptions was modified so that it
prints full stack traces on errors. So if you run with Xverbose:exceptions, you will see all exceptions thrown (without
stack traces) and see all StackOverflowErrors for example with stack traces. The verbosity example above takes this
change into account.
POSSIBLE WORKAROUND
When the application has a particular need for a very long recursion, and it is desired this works seamlessly, you can
increase/tune the thread stack size for all the threads of the JVM using the command line flag
-Xss:<desired_stack_size>[km]
Be aware that the JVM reserves that amount of space (plus a guard page) per thread in the JVM. As a JVM might
accommodate hundreds or thousands of threads, this memory reserved area for thread stacks has to be removed to
the memory the heap can grow to.
For instance, on a Windows 32 bits system limited to 2Gb processes, when the JVM handles 200 threads and you
specify -Xss:5m, this is 200*5=1000Mb = 1Gb of memory that the heap cannot use. In this specific example, the heap
thus cannot grow beyond 1Gb because of the OS restriction on the maximum process size.
The default stack size for a particular JRockit version is documented in the JRockit reference manual, and depends on
the OS and version of JVM.


Read more: http://www.wikiconsole.com/wiki/?tag=weblogic-realtime#ixzz2OL5EIbd1ORACLE
JRockit and Stack Overflow Troubleshooting
by admin under Realtime Issues, WebLogic Server
First of all, a StackOverflowError is an instance of a JVM Error, and from the very reference of the
java.lang.StackOverflowError , a JVM might not be able to survive when this condition happens.
You might thus discover the Stack Overflow condition in your production application from either repeating core
dumping, and/or alert in your application logs (typically, a StackOverflowError appears in the application logs)
WHAT TO DO
When an ORACLE JRockit Java Virtual Machine dies unexpectedly, it attempts to create a short text file, named
jrockit.<pid>.dump, by default in the directory from which the JVM was started (working directory). Then, the
Operating System will create a core file on UniX/LinuX, and minidump on Windows.
This text file (jrockit.<pid>.dump) can be easily viewed in any text editor, and the number of StackOverflowError that
happened before the JVM died is displayed conveniently in the file.
In addition, at the end of the crash report, provided the JVM died because of the StackOverflowError, the whole stack
trace (which can be extremely long) appears.
In case the StackOverflowError appears in the application log, and the JVM survives this condition, and the stack
trace is not showing up in the logs, a specific verbosity tool can be turned on inside the JVM to report this condition:
R27: $JROCKIT_HOME/bin/jrcmd <pid_of_target_JVM> verbosity
set=stackoverflow=debug
R28: $JROCKIT_HOME/bin/jrcmd <pid_of_target_JVM> verbosity
set=exceptions=info
After this command has been issued, when a Stack Overflow condition happens, the stack of the offending code path
is displayed in the stderr of the target JVM.
You can redirect the output using the specific optional argument to the command above
filename=<full_path_name_to_target_log>
The Xverbose:stackoverflow module was removed in R28. Instead Xverbose:exceptions was modified so that it
prints full stack traces on errors. So if you run with Xverbose:exceptions, you will see all exceptions thrown (without
stack traces) and see all StackOverflowErrors for example with stack traces. The verbosity example above takes this
change into account.
POSSIBLE WORKAROUND
When the application has a particular need for a very long recursion, and it is desired this works seamlessly, you can
increase/tune the thread stack size for all the threads of the JVM using the command line flag
-Xss:<desired_stack_size>[km]
Be aware that the JVM reserves that amount of space (plus a guard page) per thread in the JVM. As a JVM might
accommodate hundreds or thousands of threads, this memory reserved area for thread stacks has to be removed to
the memory the heap can grow to.
For instance, on a Windows 32 bits system limited to 2Gb processes, when the JVM handles 200 threads and you
specify -Xss:5m, this is 200*5=1000Mb = 1Gb of memory that the heap cannot use. In this specific example, the heap
thus cannot grow beyond 1Gb because of the OS restriction on the maximum process size.
The default stack size for a particular JRockit version is documented in the JRockit reference manual, and depends on
the OS and version of JVM.


Read more: http://www.wikiconsole.com/wiki/?tag=weblogic-realtime#ixzz2OL5EIbd1
what is virtual ip?
what is a proxy plugin, how will you configure it?
What is a public ip and private ip?
what do u mean by self signed certificate?
what is wlnotdelete folder?
what is xms, xmx parameters represent?
Tell me about file structure in Unix
how do u know database server is up & running?
what is the datastore ?
what is the said by said deplo?
What is the conf .xml bot?
Tell me about installation steps in weblogic server?
Difference between managed server and unmanaged server?
How will you configure a webserver to interact with a particular application server?


These two questions very much important for me:
--------------------------------
1) What are your daily day to day activities?
2) Describe the real time problems that u faced in your administration Career?
--------------------------------
3) Did u work with any tools which helps you to see the heap dump or thread dump?
4) What is 202 error, 500 server errors?
5) What is the generalized approach for Migration?
6) What is the difference between L1, L2, and L3?
The user submitted the request,
7) When that request is on processing in the middle the server Crashes then what happens?
8) How do you verify that you are using Horizontal clusters not a Vertical cluster?
9) What is vertical and horizontal scaling and their Advantages and Dis-advantages (Key points)?
10) How to check the multiple NIC in Unix or Linux?
11) To specify the weight of a cluster member in which file we have to Modify?
12) How do you find memory leaks? At what situation memory leaks Occur Give any examples? Is
there any tool to find memory leaks?


What are u r day to day activites
1)
-Web logic servers monitoring,
-Health check,
-JVM monitoring, GC pattern analysis,
-WLS logs,
-DB connection, Heap, Threads monitoring
- System CPU, memory monitoring
2) Describe the real time problems that u faced in your administration Career?
JVM run as -server compiler, Xms, Xmx,
NewSize(1/4th of Xmx) ,MaxpermSize, Permsize,
GC collection policy, Large memory pages,Heap dump etc

3)
WLS run as production mode,
Xms=Xmx, Define Permsize,
Enable verboseGC,
JDBC initial pool=Max pool size,Pool sixe>=sum of thread counts,Use prepared statement cache,
define server reload and jsp page check =-1,
Enable native IO,Cluster group define,
Use memory replication,
Separate multicast address for each cluster.
Do not add admin sever to cluster, do not target anything to admin server. etc.


3 good interview questions which i came across recently :

1) Consider box1 has node manager, admin server1 and managed server 1 & box2 has managed
server 2. Managed server 1 and managed server 2 are in cluster, on which box will the cluster be
present, box1 or box2??

2) What will be the effect if multicast ip is duplicated for 2 different
applications in a network??

3) What is the maximum memory limit in web logic??

4) What is the maximum limit of Heap?

5) What is xss?

Max limit of heap should ideally be about 80-85% of available RAM on the machine

Das könnte Ihnen auch gefallen