how to know jvm is stopping the world?
rednaxelafx at gmail.com
Tue Dec 13 03:51:43 UTC 2011
The GC start/end events in JVMTI are available since a long time ago. You
can use it in JDK 6 right now.  And in OpenJDK 7, too.
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.
On Tue, Dec 13, 2011 at 11:40 AM, Li Li <fancyerii at gmail.com> wrote:
> That's what I want.
> btw, this feature is only available in sun jdk7?
> does it exist in openjdk7?
> On Mon, Dec 12, 2011 at 11:06 PM, Stefan Karlsson <
> stefan.karlsson at oracle.com> wrote:
>> On 12/11/2011 07:31 AM, Li Li wrote:
>>> 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.
>>> 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.
>>> The first question is where is the position of CMS full gc.
>>> from http://blogs.oracle.com/**jonthecollector/entry/did_you_**know<http://blogs.oracle.com/jonthecollector/entry/did_you_know>
>>> there are many steps:
>>> 1. STW initial mark
>>> 2. Concurrent marking
>>> 3. Concurrent precleaning
>>> 4. STW remark
>>> 5. Concurrent sweeping
>>> 6. Concurrent reset
>>> 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.
>>> The second is that how to communicate between jvm and java program?
>>> My expected thing is like :
>>> //java program
>>> //system is busy, tell the dispatch node that don't send
>>> request to me
>>> do service;
>>> 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.
>> You could probably use JVMTI. See: http://docs.oracle.com/javase/**
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the hotspot-gc-dev