thanks.<div>is there any resources about writing tools communicating with JVM using JVMTI?<br><br><div class="gmail_quote">On Tue, Dec 13, 2011 at 11:51 AM, Krystal Mok <span dir="ltr"><<a href="mailto:rednaxelafx@gmail.com">rednaxelafx@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><div>The GC start/end events in JVMTI are available since a long time ago. You can use it in JDK 6 right now. [1] And in OpenJDK 7, too.</div>
<div><br></div><div>The problem (for you) is this interface does not allow you to execute any Java code in the event callback. You'll need make some non-Java interface in your dispatcher so that this notification can ultimately propagate from the JVM in full GC to your dispatcher.</div>
<div><br></div><div>- Kris</div><div><br></div><div>[1]: <a href="http://docs.oracle.com/javase/6/docs/platform/jvmti/jvmti.html#GarbageCollectionStart" target="_blank">http://docs.oracle.com/javase/6/docs/platform/jvmti/jvmti.html#GarbageCollectionStart</a></div>
<br></div><div class="gmail_quote"><div class="im">On Tue, Dec 13, 2011 at 11:40 AM, Li Li <span dir="ltr"><<a href="mailto:fancyerii@gmail.com" target="_blank">fancyerii@gmail.com</a>></span> wrote:<br></div><div>
<div></div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That's what I want.<div>btw, this feature is only available in sun jdk7? </div><div>does it exist in openjdk7?<div><div></div><div><br><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 11:06 PM, Stefan Karlsson <span dir="ltr"><<a href="mailto:stefan.karlsson@oracle.com" target="_blank">stefan.karlsson@oracle.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div>On 12/11/2011 07:31 AM, Li Li wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
hi,<br>
In our application of full text searching with lucene and solr. we will give jvm about 25GB memory. we use CMS as old generation garbage collector. But the jvm sometimes can't do anything. So our clients complain that the connection is time out. we find the reason is the jvm is doing full gc and it will stop service for about 1-3 seconds.<br>
I know that this situation is inevitable when using CMS collector. but we have more than one searching machines, so if I know jvm is doing full gc(specially stop the world), I can send requests to other machines. But the question now is that jvm don't provide an api for that. I think it's not very difficult(for guys developing hotspot, but is in deed difficult for me ). So I want your help.<br>
The first question is where is the position of CMS full gc.<br>
from <a href="http://blogs.oracle.com/jonthecollector/entry/did_you_know" target="_blank">http://blogs.oracle.com/<u></u>jonthecollector/entry/did_you_<u></u>know</a><br>
there are many steps:<br>
1. STW initial mark<br>
2. Concurrent marking<br>
3. Concurrent precleaning<br>
4. STW remark<br>
5. Concurrent sweeping<br>
6. Concurrent reset<br>
there are 2 stop the world stages. I want to know the line number(or functions) of this stages. so I can tell java program that jvm now is doing full gc.<br>
The second is that how to communicate between jvm and java program? My expected thing is like :<br>
//java program<br>
if(System.isStopTheWolrd()){<br>
//system is busy, tell the dispatch node that don't send request to me<br>
}else{<br>
do service;<br>
}<br>
I have no experience in jvm developing. jvm is implemented in c and jni is the interface between them. is there any other method that jvm can achieve this? obviously, it can extend System class and add a static method named isStopTheWorld(). Could some one tell me how to do this in details? Thank you very much.<br>
</blockquote>
<br></div></div>
You could probably use JVMTI. See: <a href="http://docs.oracle.com/javase/7/docs/platform/jvmti/jvmti.html#GarbageCollectionStart" target="_blank">http://docs.oracle.com/javase/<u></u>7/docs/platform/jvmti/jvmti.<u></u>html#GarbageCollectionStart</a><br>
<br>
StefanK<br>
</blockquote></div><br></div></div></div>
</blockquote></div></div></div><br>
</blockquote></div><br></div>