Académique Documents
Professionnel Documents
Culture Documents
• Thread can also be generated by configuring the JVM using DOS prompt. Need to press
ctrl+Break buttons simultaneously.
• You will see hung threads exception in logs be’se app or any system behaviour.
Garbage Collection (GC)
An object is garbage when it can no longer be reached from any pointer in the running
program.
The JVM performance can be improved by reducing GC duration. The response time will
get reduced if we reduce the GC duration.
The GC will be taken place in different generations, young generation (minor collections)
and old generation (major collections). The GC activity takes place in different generations
as some objects need to be live longer and some of the objects can be collected after their
work is done.
The minor collections are also called as scavenges. The GC duration of scavenges are much
lower than the major collections. The scavenges duration is <1 sec. The major collection
GC duration is b/w 5 and 13 seconds.
GC occurs in each generation when it fills up.
Young generation contains different regions like eden and survivor spaces. The objects
created in eden. The objects die there be’se infant mortality. When eden fills up it causes
minor collection, in which some surviving objects are moved to an older generation.
JVM heap reaches 80% (by default) of heap size then major collection occurs.
The JVM will Stop The World (STW) during the major collection.
GC
• Young generation contains Eden, and two survivor spaces.
• The different JVM arguments which decide the memory allocation for young and old
generations.
• Xmn and survivor ratio values are defined in Generic JVM arguments list of a JVM.
JVM takes default values if you do not specify generic args.
• Xmn – Young generation value/parameter.
• The space is allocated to eden and survivor spaces based on the survivor ratio.
• Suvivor Ratio = Eden space : Survior space
• Eg: Xmn = 180m (if you do not specify Xmn, JVM calculates and assign the Xmn value
in Heap size), Survivor ratio = 4 (Default value is 16). Survivor Ratio = Eden space:
Survivor space
• Survivor Ratio = 4 => Eden = 180*4/6 = 120m. Survivor is 30m.
• Two parts are allocated to survivor space.
• JVM heap size as 768m, Xmn = 180, Old generation space = 768 – 180 = 588m.
• The JVM heap is allocated based on your requirements like how many applications are
going to run in a JVM and how big and how busy they are.
GC
• Permanent Generation : (perm size) : In which JVM and application classes will be
stored. The perm Gen size is different from heap size, In other words perm Gen space is
not included in heap size.
• Note: If you make many deploys to one JVM/cluster, the permGen will go OOM. The
JVM needs to be restarted when permGen goes to OOM.
• PermGen is defined in Generic arguments list, -xx:permGen. There will be minimum
permGen and max permGen spaces.
• JVM arguments : Servers > Application Servers > <serverName> > Java Process and
Management > Process definition > JVM, Generic JVM arguments
• Initial/Max heap size are set in Initial and Max heap size bizes respectively.
• Note: usually initial and max heap sizes are allocated equally to avoid the memory
leakages.
• Note: The saw tooth wave ( sin wave) in Tivoli represents there are no memory
leakages.
To target JVMs/clusters for a app : console > Applications > enterprise applications >
app-name > Target mappings
To Know application context root, Click on view deployment descriptor
To Map or the application from one cluster to another cluster, Click “Map modules to
Servers” > select Modules, target servers and click “apply”. Save it and Synch it.
Start the application.
Disable app to not to start with JVM start/restart, App-name > Target mappings > click
in server/cluster > uncheck “enabled”. Save and Synch.
You can view security roles and datasources or JNDIs for a app using console.
• JVM Heap size=768m 128m
S
Eden= S U
180*4/6= U R
Old
120m R V
V generatio Perm
I
I n/ Major anent
V
V colletion gener
O
O R 588m ation
R 3
30 0
m
Young generation/minor colletions
Scavanges = 180m