-
1. Re: FullGC at start-up even before application deployment?
rhusar Sep 21, 2011 5:58 AM (in response to elshafei.mostafa)1 of 1 people found this helpfulJust shooting this in the wild, but maybe something is calling System.gc()? I am not sure why this is a performance problem for you, because at this point the server is only starting and the application is just getting deployed, so no clients suffer from slow response times, etc. But if its a problem maybe you could try using -XX:-DisableExplicitGC ?
-
2. Re: FullGC at start-up even before application deployment?
wdfink Sep 21, 2011 6:31 AM (in response to elshafei.mostafa)It depends also to the start parameter of the JVM, e.g. Xms Xmx and whether the complete memory is allocated or virtual (see startup and boot.log to see full JVM params).
Also I recommend to use the latest JVM version of 1.5 (if you use this), but remember the 1.6 will be better and often faster (depend to the application).
-
3. Re: FullGC at start-up even before application deployment?
elshafei.mostafa Sep 21, 2011 7:26 AM (in response to rhusar)Thx Radoslav Husar for answering. However, I tried -XX:-DisableExplicitGC and it still starts with a full GC. Even if its not a performace problem I would like to know the cause.
-
4. Re: FullGC at start-up even before application deployment?
elshafei.mostafa Sep 21, 2011 7:29 AM (in response to wdfink)Here's my full JAVA OPTS configuration:
JAVA_OPTS="-Xms2g -Xmx2g -XX:NewSize=1g -XX:MaxNewSize=1g -XX:PermSize=256m -XX:MaxPermSize=256m -Xss256k -server -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Xloggc:/X/X/X.log -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:ParallelGCThreads=4 -XX:+AggressiveHeap -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/X/X/X -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
-
5. Re: FullGC at start-up even before application deployment?
wdfink Sep 21, 2011 7:54 AM (in response to elshafei.mostafa)You use conflicting GC settings and I don't know what the JVM prefere in this case.
See http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html for detail on options.
I prefere UseParallelGC (only not Old) or 'UseConcMarkSweep AND CMSIncrementalMode' but the performance depends stron on the application memory footprint
So I recommend to not think about optimizing without measure the app, you should drop NewSize option and try to use NewParGC or CMS.
See what happen, you might watch with jstat or VisualVM.
Also I miss the information about the JVM version...
-
6. Re: FullGC at start-up even before application deployment?
elshafei.mostafa Sep 21, 2011 8:10 AM (in response to wdfink)Thank Wolf-Dieter Fink for your reply. However, I can't understand what do you mean by conflicting GC?
What is the difference between ParallelGC and ParallelOldGc?? In the link you proposed it is mentiod that ParallelOldGc automatically enable ParallelGC.
I am always measuring what's happening by viewing GC logs and HeapDumps.
The JVM version is build 1.5.0_12-b04.
-
7. Re: FullGC at start-up even before application deployment?
wdfink Sep 21, 2011 9:44 AM (in response to elshafei.mostafa)1 of 1 people found this helpfulOldParallelGC is an old implementation and the New implementation (from 1.4.1) should be better most times for JBoss and such long running servers. So drop -XX:UseParallelOldGC, also I would drop -XX:+CMS stuff.
Also fixing the eden space (NewSize) might have bad sideeffects because of reducing the OldGen.
I recommed to use the latest 1.5. JVM!
-
8. Re: FullGC at start-up even before application deployment?
elshafei.mostafa Sep 21, 2011 10:06 AM (in response to wdfink)Concerning the JVM 1.5, its an organizational decision.
However, lets get to the main point of this discussion. Why there is always a full GC at the server startup?
-
9. Re: FullGC at start-up even before application deployment?
wdfink Sep 21, 2011 10:37 AM (in response to elshafei.mostafa)As "Radoslav Husar" mentioned there might be a explicit GC request from a deployed app (avoid with -XX:-DisableExplicitGC).
If not there is no exact point how a FullGC happen, it's a decision of the JVM depend on memory consumption of the different spaces and the frequence of minor GC.
Maybe jstat gives a hint (see oracle jstat documentation).
It might disapear with a new JVM version.
In other words I don't know exactly and if it do not disturb my application, e.g. happen very often, I don't care about
-
10. Re: FullGC at start-up even before application deployment?
elshafei.mostafa Sep 21, 2011 10:47 AM (in response to wdfink)Okay. Thanks anyway.
-
11. Re: FullGC at start-up even before application deployment?
peterj Sep 21, 2011 12:39 PM (in response to elshafei.mostafa)The call to System.gc() is coded into the app server (or into one of the libraries it uses - I know the the RMI libraries like to make GC calls), I suspect as it transitions from bootstrap to the app server itself. I think it might also perform another GC or two after deployment or other major initialization activity. I think the idea behind this was to have the heap as clean of junk as possible before handling user requests. Of course, that made sense years ago when when servers didn't have that much memory and heaps were smaller. I have seen this behavior in JBoss AS release from 4.0.x up through 5.x (haven't monitored GC behavior on 6). I don't know if AS 7 stil lexhibits this behavior.
-
12. Re: FullGC at start-up even before application deployment?
rhusar Sep 21, 2011 12:48 PM (in response to peterj)I don't know if AS 7 stil lexhibits this behavior.
Right, AS7 does not do this anymore.
-
13. Re: FullGC at start-up even before application deployment?
ask4free Sep 21, 2011 2:26 PM (in response to elshafei.mostafa)Hi Mostafa,
mmm... that Full GC only takes 0.9427300 secs !! where's the problem? hehehehe... FullGCs are not a problem if they're not impacting on the user's response time. Just start the server and run some stress testing to check the heap performance of your application ( I remember of having FullGCs of 10 seconds in some stress testing, so it was really a huuuuuuge "little" problem ! however, it was finally solved by "playing" with some jvm parameters )
take care!
-
14. Re: FullGC at start-up even before application deployment?
elshafei.mostafa Sep 22, 2011 3:48 AM (in response to peterj)Thanks Peter. That's what I wanted to know.
However, why when I use -XX:-DisableExplicitGC it still starts with a Full GC?