[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-hotspot-gc-use
Subject:    Re: Garbage Collection - timings and suspension
From:       Vitaly Davidovich <vitalyd () gmail ! com>
Date:       2016-07-26 13:57:10
Message-ID: CAHjP37FZ_TaSaRK1aOtTBNd8KkEstm6unZnn2gqOnKm0PzhoUw () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Yes, JIT will do it for deoptimizations; code cache flushing; class
redefinition; biased lock revocations is another common one.
GuaranteedSafepointInterval that Thomas mentioned checks if a safepoint is
needed every interval, but doesn't necessarily trigger it (it's predicated
on whether there are any inline cache buffers that need to be cleaned,
IIRC).

Searching for "JVM safepoints" will give you many references to read.

On Tuesday, July 26, 2016, Rohit Mohta <rmohta.coder@gmail.com> wrote:

> Hi Thomas,
>
>     What could be the other reasons for stopping all application threads?
> Like JIT? Any reference I can read through and understand more?
>
> And thank you for PrintSafePointStatistics.
>
> Cheers,
> Rohit
>
> On Tuesday, July 26, 2016, Thomas Schatzl <thomas.schatzl@oracle.com
> <javascript:_e(%7B%7D,'cvml','thomas.schatzl@oracle.com');>> wrote:
>
>> Hi Rohit,
>>
>>   just some addition to Jenny's response:
>>
>> On Mon, 2016-07-25 at 15:17 +0000, Rohit Mohta wrote:
>> > Hi All,
>> >
>> >    Can someone please help me understand the below snippet of Garbage
>> > Collection logs?
>> >
>> [...]
>> >
>> > (b)    I can see "Stopping threads took: 0.0001230 seconds" statement
>> > in numerous occasions. Even when, GC was not taking place.
>>
>> There are many other causes of the VM stopping all threads than garbage
>> collection, for many different purposes.
>>
>> >  ·        What does it mean by ‘stopping threads took'? Does it mean,
>> > garbage collector process was trying to ‘park' all the threads,
>> > without interrupting ongoing instructions. So it had to wait for
>> > ongoing processing to complete, before it could put the thread in
>> > ‘park' state?
>>
>> This message means what you describe, i.e. this is the time from
>> signalling the threads in the VM to stop until all of them are stopped.
>>
>> >  ·        Why does JVM stop application threads even when we don't see
>> > any Full GC events? In my system, full gc event is fired every 60
>> > mins – but I can see the above statement numerous times. Why does
>> > that happen?
>>
>> The VM needs to do other kind of accounting next to garbage collection
>> that requires a stop-the-world pause.
>>
>> >  ·        When we talk about GC Suspension time, our definition is –
>> > "time for which application will not process anything. Application
>> > kinda hangs". Should we consider these "Total time for which
>> > application threads were stopped" also as Suspension time?
>>
>> Yes.
>>
>> >  ·        Any best practices to reduce the suspension time (apart from
>> > GC friendly code)?
>>
>> This depends on the reason for the suspension that should be printed if
>> PrintSafepointStatistics is turned on. One potential knob to turn is
>> GuaranteedSafepointInterval. Note that it is not advised to make this
>> overly long or turn it off completely (default is 1s).
>>
>> Thanks,
>>   Thomas
>>
>> _______________________________________________
>> hotspot-gc-use mailing list
>> hotspot-gc-use@openjdk.java.net
>> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>>
>

-- 
Sent from my phone

[Attachment #5 (text/html)]

Yes, JIT will do it for deoptimizations; code cache flushing; class redefinition;  \
biased lock revocations is another common one.   GuaranteedSafepointInterval that \
Thomas mentioned checks if a safepoint is needed every interval, but doesn&#39;t \
necessarily trigger it (it&#39;s predicated on whether there are any inline cache \
buffers that need to be cleaned, IIRC).<br><br>Searching for &quot;JVM \
safepoints&quot; will give you many references to read.<div><span></span><br>On \
Tuesday, July 26, 2016, Rohit Mohta &lt;<a \
href="mailto:rmohta.coder@gmail.com">rmohta.coder@gmail.com</a>&gt; \
wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px \
#ccc solid;padding-left:1ex">Hi Thomas,<div><br></div><div>      What could be the \
other reasons for stopping all application threads? Like JIT? Any reference I can \
read through and understand more?</div><div><br></div><div>And thank you for \
PrintSafePointStatistics.  \
</div><div><br></div><div>Cheers,</div><div>Rohit<br><br>On Tuesday, July 26, 2016, \
Thomas Schatzl &lt;<a \
href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;thomas.schatzl@oracle.com&#39;);" \
target="_blank">thomas.schatzl@oracle.com</a>&gt; wrote:<br><blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex">Hi Rohit,<br> <br>
   just some addition to Jenny&#39;s response:<br>
<br>
On Mon, 2016-07-25 at 15:17 +0000, Rohit Mohta wrote:<br>
&gt; Hi All,<br>
&gt;   <br>
&gt;      Can someone please help me understand the below snippet of Garbage<br>
&gt; Collection logs?<br>
&gt;<br>
[...]<br>
&gt;   <br>
&gt; (b)       I can see "Stopping threads took: 0.0001230 seconds" statement<br>
&gt; in numerous occasions. Even when, GC was not taking place.<br>
<br>
There are many other causes of the VM stopping all threads than garbage<br>
collection, for many different purposes.<br>
<br>
&gt;  ·               What does it mean by ‘stopping threads took'? Does it \
mean,<br> &gt; garbage collector process was trying to ‘park' all the threads,<br>
&gt; without interrupting ongoing instructions. So it had to wait for<br>
&gt; ongoing processing to complete, before it could put the thread in<br>
&gt; ‘park' state?<br>
<br>
This message means what you describe, i.e. this is the time from<br>
signalling the threads in the VM to stop until all of them are stopped.<br>
<br>
&gt;  ·               Why does JVM stop application threads even when we don't \
see<br> &gt; any Full GC events? In my system, full gc event is fired every 60<br>
&gt; mins – but I can see the above statement numerous times. Why does<br>
&gt; that happen?<br>
<br>
The VM needs to do other kind of accounting next to garbage collection<br>
that requires a stop-the-world pause.<br>
<br>
&gt;  ·               When we talk about GC Suspension time, our definition is \
–<br> &gt; "time for which application will not process anything. Application<br>
&gt; kinda hangs". Should we consider these "Total time for which<br>
&gt; application threads were stopped" also as Suspension time?<br>
<br>
Yes.<br>
<br>
&gt;  ·               Any best practices to reduce the suspension time (apart \
from<br> &gt; GC friendly code)?<br>
<br>
This depends on the reason for the suspension that should be printed if<br>
PrintSafepointStatistics is turned on. One potential knob to turn is<br>
GuaranteedSafepointInterval. Note that it is not advised to make this<br>
overly long or turn it off completely (default is 1s).<br>
<br>
Thanks,<br>
   Thomas<br>
<br>
_______________________________________________<br>
hotspot-gc-use mailing list<br>
<a>hotspot-gc-use@openjdk.java.net</a><br>
<a href="http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use" \
target="_blank">http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use</a><br> \
</blockquote></div> </blockquote></div><br><br>-- <br>Sent from my phone<br>



_______________________________________________
hotspot-gc-use mailing list
hotspot-gc-use@openjdk.java.net
http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic