young generation gc some times takes longer time

jdk: 1.4.2_06

jvm parameters:

-Xms2560m -Xmx2560m -XX:NewSize=32M -XX:MaxPermSize=256M -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC

-XX:+UseParNewGC -

nature of our application is that most of the new objects which are cretaed most likely is going to end up in tenured space so we have kept newsize small.

Our young gc is frequent but takes vet less time most of the time and it is like this most of the time

1892801.223: [ParNew 1307000K->1276979K(2621376K), 0.0405279 secs]

1892803.702: [ParNew 1309619K->1280021K(2621376K), 0.0381812 secs]

1892810.257: [ParNew 1312661K->1282979K(2621376K), 0.0430851 secs]

1892813.616: [ParNew 1315619K->1285174K(2621376K), 0.0353861 secs]

1892820.838: [ParNew 1317814K->1287959K(2621376K), 0.0391169 secs]

1892825.486: [ParNew 1320599K->1294498K(2621376K), 0.1225365 secs]

1892825.883: [ParNew 1327138K->1309838K(2621376K), 0.4025240 secs]

1892832.756: [ParNew 1342478K->1315852K(2621376K), 0.1057747 secs]

1892838.118: [ParNew 1348492K->1317861K(2621376K), 0.0320176 secs]

1892843.932: [ParNew 1350501K->1319480K(2621376K), 0.0383975 secs]

but one or twice in a day it start taking higher gc time for new generation for 2-3 minute till gc happens for old generation

311536.095: [ParNew 1583769K->1556941K(2621376K), 0.2767211 secs]

311536.768: [ParNew 1659394K->1638895K(2621376K), 0.5441500 secs]

311537.638: [ParNew 1671535K->1650538K(2621376K), 0.4639280 secs]

311538.849: [ParNew 1683178K->1652904K(2621376K), 0.4405431 secs]

311540.088: [ParNew 1685544K->1659556K(2621376K), 0.4570603 secs]

311545.027: [ParNew 1692196K->1661921K(2621376K), 0.4514625 secs]

311547.213: [ParNew 1694561K->1664354K(2621376K), 0.4518378 secs]

311553.699: [ParNew 1696994K->1666712K(2621376K), 0.4341839 secs]

311556.270: [ParNew 1699352K->1668499K(2621376K), 0.4293822 secs]

311559.200: [ParNew 1701139K->1670185K(2621376K), 0.4406644 secs]

311562.732: [ParNew 1702825K->1672748K(2621376K), 0.4399115 secs]

311563.772: [ParNew 1705388K->1674850K(2621376K), 0.4561811 secs]

311568.178: [ParNew 1707490K->1677631K(2621376K), 0.4509551 secs]

311569.400: [ParNew 171027

We rarely have Full GC. Mostly minor GC of 2-3 seconds. Once minor GC happens , new generation comes back to .04 sec from .5 sec

311660.144: [ParNew 1789014K->1758802K(2621376K), 0.4462287 secs]

311662.122: [ParNew 1791442K->1762257K(2621376K), 0.4457078 secs]

311662.570: [GC 1762289K(2621376K), 0.0171463 secs]

311664.142: [ParNew 1794897K->1765945K(2621376K), 0.4635559 secs]

311666.224: [GC 1771006K(2621376K), 1.6403867 secs]

311670.893: [ParNew 1492500K->1462823K(2621376K), 0.4980912 secs]

311672.790: [ParNew 1357566K->1327406K(2621376K), 0.5134905 secs]

311673.748: [ParNew 1328011K->1303516K(2621376K), 0.4523868 secs]

311675.227: [ParNew 1239373K->1212039K(2621376K), 0.4482543 secs]

311677.571: [ParNew 1037272K->1006895K(2621376K), 0.4341042 secs]

311681.144: [ParNew 584941K->554178K(2621376K), 0.0314600 secs]

311682.233: [ParNew 586818K->557176K(2621376K), 0.0409105 secs]

311683.170: [ParNew 589816K->563481K(2621376K), 0.0589575 secs]

311686.489: [ParNew 596121K->565244K(2621376K), 0.0335869 secs]

311689.309: [ParNew 597884K->567601K(2621376K), 0.0351472 secs]

To me it looks like our old generation is fragmented and promotion from new generation to old generation start taking longer time. But once Minor GC happens an dfree up spaces from old generation then we longer sees pauses of .5 seconds every 1 seconds

I am thinking to increase newsize as well as use following

UseCMSCompactAtFullCollection

-XX:CMSFullGCsBeforeCompaction=0

-XX:-CMSParallelRemarkEnabled

we haven't used these earlier becasue we thought these are default to these in 1.4.2

any other suggestion?

how we can prevent fragmentaion of old space. full gc can adjsu old space but in our case we don't have many full gc's.

[4248 byte] By [anujlal1a] at [2007-11-26 14:11:23]
# 1
any gc gure who can thorw some light on this
anujlal1a at 2007-7-8 1:59:24 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2
is this monitored by any jvm guru ?
anujlal1a at 2007-7-8 1:59:24 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3
I think I would look at SurvivorRatio and TenuringThreshold. http://java.sun.com/performance/reference/whitepapers/tuning.html#section4.2.6
tschodta at 2007-7-8 1:59:24 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 4

As tschodt indicated, increasing the NewSize as well as

SurvivorRatio and MaxTenuringThreshold so as to reduce

the promotion rate into the old generation might help.

To see if it helps you can use -XX:+PrintTenuringDistribution to

see if aging objects in the survivor spaces stems the

tenuring rate substantially or not.

You may also consider manually setting the CMSInitiatingOccupancyFraction

parameter so as to trigger a CMS old generation collection cycle

sooner than is the case currently.

Finally, consider moving to a newer version of the JDK. In particular

1.5.0_09 (or later) or 1.6.0 (or later) have substantially improved both

the performance, scalability and "autonomicity" of the concurrent

collector quite substantially.

ramki_at_jdca at 2007-7-8 1:59:24 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 5

increasing newsize to 640 and survivor ratio to 5 and tenuringthrehhold to 6 improved performance.

But still sometime parnewgc still takes longer time esp when

eden is 100% and fromspace is 100% before GC. After GC from sapce is only 15% full but jvm still propgates close to 180M to old space ( instead trying some of it in ageing space). This behavior I am not able to understand.

Also, we can't move to 1.5 version becasue of weblogic 8.1 release.

I am worndering whether changes made in 1.5.0._09 or later release is ported to 1.4.2_13 ( latest 1.4 release) ?

anujlal2a at 2007-7-8 1:59:25 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 6

Please run your application with -XX:+PrintGCDetails -XX:+PrintGCTimeStamps

-XX:+PrintTenuringDistribution and send the logs along with a complete list of all

the JVM options used to hotspotgc dash feedback at sun dot com and we'll

look at your logs.

For quickest response, if you have a Sun support contract, please copy

your Sun account manager. For a list of support offerings from Sun,

point your browser to developers.sun.com/services

There are no current plans to port the 6.0 or 5.0 performance

work to 1.4.2.

ramki_at_jdca at 2007-7-8 1:59:25 > top of Java-index,Java HotSpot Virtual Machine,Specifications...