JConsole: Meaning of TOTAL WAITED and TOTAL BLOCKED in Thread View

I'd like to know the meaning of the TOTAL WAITED and TOTAL BLOCKED values shown on the right pane when clicking on a thread in the THREAD tab. I have reviewed the JConsole Documentation but it fails to indicate their meaning.
Thank you,
Juan Velez

Blocked count is the total number of times that the thread blocked to enter or reenter a monitor. I.e. the number of times a thread has been in the java.lang.Thread.State.BLOCKED state.
Waited count is the total number of times that the thread waited for notification. i.e. the number of times that a thread has been in the ava.lang.Thread.State.WAITING or java.lang.Thread.State.TIMED_WAITING state
jconsole is showing the information from java.lang.management.ThreadInfo class:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/management/ThreadInfo.html

Similar Messages

  • Wake up, wait, and kill one / many threads

    Hello all.
    I am trying to do something that I originally wanted to do with multicasting, but in the end could not.
    Essentially I want to create a bunch of threads, one for each machine I want to 'ping' (not the actual ping, just some kind of 'are you alive?'). These threads will just sit there and wait upon creation.
    Then when a request comes in I want to:
    1. wake them all up so they all send a 'ping' to their respective server.
    2. retrieve the ip address (or name) of the first thread that replies
    3. kill the rest of the threads (if they haven't already died)
    4. go back to waiting
    I've been surfing Google, Java tutorial and these forums and can't seem to put it all together.
    Many thanks for any help!
    Bob

    Hello again, thanks for all of the responses.
    I feel like a bit of a schmuck, I had no idea J2SE 5.0 had all of this new concurrency stuff. All of these things -- Semaphores, CountDownLatch, etc. -- are new to me. I've been trapped in the web / MVC world too long. I've used threads in the past but only for simple stuff, always trying to avoid all the messy stuff like synchronized blocks, wait(), notify(), etc.
    So I am boning up on all this new stuff now, thanks.
    As for you comment, 'I don't see the point in terminating them if you are going to repeat the exercise.', you're right, I didn't mean kill the threads that didn't reply first, I meant ignore them.
    Basically I have a situation where I'll have something like 60 requests per minute on average. For each request I want to wake up all the threads, send out a ping and send the request to the ip address of the first thread that replies.
    The problem of course is that during that one request I may have another, and another, since a ping could take anywhere from less than a second to 5 seconds to timeout. So, for example, If another request comes in while 3 out of the total of 5 threads are still pinging, only 2 will be woken up to send out another ping, and so on.
    It's complicated and it would be a lot easier with a simple multicast message using JGroups or a simple Java multicasting. But alas since these servers that I'll be pinging aren't ours, I can neither install a small multicast listener program on them or even be sure multicasting (port 124.0.0.1) is enabled.
    So that's the deal. I'm going to keep reading. Thanks for all of your help!
    Bob

  • My brand new iPod is totally blocked.... (?!)

    hi there,
    Can someone help out?
    Our iPod is totally blocked and nothing works to get it going again (on/off button at top... home button.... and/or combination of both)
    Connecting to computer (itunes) also doesn't help a thing.... out of options for the moment.
    Next thing is to just sit and wait till battery's dead.... will take hours.... and then 'hope' all's fine again.
    Looking forward to any suggestion.
    thanks a lot,
    E.

    - Try:
    iOS: Not responding or does not turn on
    - If not successful and you can't turn the iPod fully off, let the battery fully drain. After charging for at least an hour try the above again.
    - If still not successful that indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.

  • I want to be able to totally block the FaceTime functionality in my home network.  I would like to do this at the router level.  Does anyone know the hostname or IP address that the FaceTime application uses? Or which port it connects to?

    I want to be able to totally block the FaceTime functionality in my home network so my 4 kids aren't using the Facetime feature- It was easy for Skype just had to enter the work Skype on my Router Security list- and it denies access. I would like to do this at the router level for FaceTime? Only site I find in init.ess.apple.com - is this the startup site for Facetime?   Does anyone know a site I can block, hostname or IP address that the FaceTime application uses? Or which port it connects to?

    I would presume so, but it might be worth your while to experiment and play around with different combinations to see if you can block FaceTime while keeping Game Center open.  Good luck!

  • Vendor Total Block 99 , was unable to block against payment

    Dear Friends,
    Vendor was total block 99 on Dec 2012.
    However, the system did not stop when payment was being made to the vendor on Jan, 13?
    Please explain when this is happening even after vendor block was done.
    Regards
    Sridhar

    do you want to say you entered a 99 in XK05 transaction?
    Have you read the F1 field help? This block is material specific and only affects a business case for a material that has QM in procurement activated.
    if you want to block a vendor from any business, then you have to use the boxes (block company code and block purchasing org)  above that field.

  • How to find the size of the pipe. I mean the total number of bytes/messages available in the named pipe?

    How to find the size of the pipe. I mean the total number of bytes/messages available in the named pipe?
    NAVEEN

    I'm afraid this forum for Microsoft Project Customization and Programming  is not the correct forum for your question. Please Choose correct forum in order
    to get help from experts. I think your question is more relevant to SQL server
    kirtesh

  • IPod 3g totally blocked :(

    Hi. I have big problem with my iPod 3g.
    Few days ago it totally blocked itself. I turned it on and wanted to play music and suddenly it restarted and now it is only showing Apple logo. My computer or iTunes won't recognize it. I tried restarting it and when I do it, there is no change, only an Apple logo is displayed and it won't react to nothing.
    Does anyone have any suggestions?

    Hi ulatoja1
    Thanks for the tip, I have tried your advice but I still have the same problem. When I reset it, it is still totally blocked and all I see on the display is an Apple logo.
    I have taken it to the Apple dealership and they should fix the problem.

  • How to get total no. of threads in JVM?

    I am trying to monitor the thread activity to detect any thread-leak in our system. Is there a way to get total number of threads so far being created in the JVM?
    Thanks in advance.
    - David

    Thanks for the suggestion of getParent(). I actually found that the "activeCount()" method always returm me a number larger than I expect. I have to enumerate the thread group to get an array of Thread objects and count the array one by one. Then I will get the correct number of threads as I expected.
    Don't know exactly the meaning of "active" threads.
    - David

  • Wait and notify in servlets?

    i am having a servlet , which is implementing wait and notify of java.lang.Object.
    when serving it for single request , its waiting and working fine...
    but for multiple requests its not serving properly. works one by one means the second request is waiting for finishing the first request just like SingleThreadModel (after finishing the first request only second request entering inside servlet)
    please help me to solve this?
    or is there any other way to call wait method without synchronized block??

    Shynihan wrote:
    or is there any other way to call wait method without synchronized block??No, and that's partly because if wait or notify is the only thing in the synchronized block then you probably aren't using them right. The problem is blocking the server thread. Servlet engines use a thread pool to execute transactions, when a new transaction comes in a thread is taken from the pool to run it, and there's usually a limited number of threads in the pool. If there's no threads left then the transaction will wait for another to finish.
    If your servlets freeze up, then that's a thread gone from the pool.
    And remeber the unlocking transaction may never arive. The client could go down at any time, leaving the server thread permanently hung.
    You need to move this waiting to the client side. If the transaction cannot proceed then return a "come back later" response immediately. The client can then retry after a decent interval.

  • Session: Waiting and Working Chart

    I am using OEM 10g (Grid control) to monitor my database.
    But I don know what does the Y axis on the chart (Session: Waiting and Working) mean ?
    Thanks for your help.
    Note: Click Home page -> Database -> Performance -> Sessions: Waiting and Working.

    2 store the user name in the session to display as a welcome message to the user when they are logged in.]
    in class where you match the username and password .if given user is exist in records then set it into session
    HttpSession session =request.getSession();
    session.setAttribute("",);
    3 tell the user they dont exist in the database or that there password is wrong and give them the option to either A) reset the password or B) create a user
    in same class if user does not exist the redirect the request to different pages in that pages you put these two like A) reset the password or B) create a user

  • What is the difference between buffer busy waits and free buffer waits

    what is the difference between buffer busy waits events and free buffer waits in Oracle database?
    select *
    from
       v$system_event
    where
       event like ‘%wait%’;
    EVENT                       TOTAL_WAITS TOTAL_TIMEOUTS TIME_WAITED AVERAGE_WAIT
    buffer busy waits                636528           1557      549700   .863591232
    write complete waits               1193              0       14799   12.4048617
    free buffer waits                  1601              0         622   .388507183

    jetq wrote:
    Buffer busy waits occur when an Oracle session needs to access a block in the buffer cache, but cannot because the buffer copy of the data block is locked. This buffer busy wait condition can happen for either of the following reasons:
    * The block is being read into the buffer by another session, so the waiting session must wait for the block read to complete. If the OP is running 10g, that would be recorded as "read by other session" not "buffer busy waits" - and unfortunately he didn't tell us the version.
    * Another session has the buffer block locked in a mode that is incompatible with the waiting session's request.
    The Free Buffer Waits Oracle metric wait event indicates that a server process was unable to find a free buffer and has posted the database writer to make free buffers by writing out dirty buffers.
    There is another possibility - if the OP is using a keep and recycle pool: see http://jonathanlewis.wordpress.com/2006/11/21/free-buffer-waits/
    Regards
    Jonathan Lewis
    http://jonathanlewis.wordpress.com
    http://www.jlcomp.demon.co.uk
    To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
    "For every expert there is an equal and opposite expert"
    Arthur C. Clarke                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Wait() and notifyall() problem in servlet.

    Can anyone help me with this.....
    I am creating an application which has one gateway inside which
    handles for logger, dbmodule etc are made and passed to biz logic.
    This biz logic using logger obj made in gateway, does the logging.
    Now i hv to do serial implementation of logging i.e I have
    a static member which is of type Vector, which will hold
    a list of messages and associated parameters. The write() method will
    create a formatted message with all values inserted, all prefixes and
    suffixes added, etc. Then it will append the message to the Vector of
    messages. And there will be a separate thread, which will be started
    the
    first time the first Logger instance is created. This thread will keep
    picking up messages from this Vector in FIFO order and writing them
    out.Mind you, I don't mean i need to use a single shared Logger
    instance.
    Separate Logger instances must be used to hold separate values for
    sessionID, username, etc. Only the internal logging I/O stream handle
    should be shared.
    For this what i hv created logger class as follows:
    logger {
    SyslogAppender SA;
    logger() {
    new SA;
    ThreadGroup TG = new ThreadGroup("string");
    Logging target = new Logging();
    Thread DT = new Thread(TG, target, "daemon");
    DT.setDaemon(true);
    DT.start();
    class write {
    write() {
    //initialisation;
    void writetovector() {
    addtovector
    notifyall;
    class logging implements runnable {
    public void run() {
    while(vector is not empty){
    log
    synchronised(this){
    wait();
    Now in the servlet, in init(), logger is called with this constructor
    and therefore there is only one instance of syslog appender to log in
    syslog.
    In service i just call the function writetovector through a method in
    logger.
    However when i run the implemented version of this, logging does not
    take place.
    I feel my implementation of wait and notifyall is not correct. Or is
    there any other problem?
    thanx in advance

    There are many problems with your code. It looks like you retyped it, and it now contains many syntax errors. Two problems I can see, though, are that you do not call notifyAll from synchronized code, and your call to wait is not in a loop.

  • A bug in wait and notify? -- help

    Now I am engaged in a simulation project. The threads are all controlled by the controller program, that is, they are often blocked and unblocked by using wait and notify methods. However, when I was debugging my program, there were always some errors occurring and halting the simulation. And I found that the cause was that the threads sometimes might halt after having executed the wait or notify methods!!
    Example,
    in thread 1, it would be blocked by a wait method like:
    synchronized(lock){
    lock.wait();
    System.out.println("Thread 1 go on.");
    In thread 2, it would unblock thread 1 with the notify method:
    synchrnoized(lock){
    System.out.println("Thread 2 would notify the threads blocked on lock.");
    lock.notifyAll();
    System.out.println("Thread 2 go on.");
    The simulation program controls the time to execute the thread 2. However, in debugging the program I often encountered the problem that thread 2 did notify thread 1 and thread would go on executing, but thread 2 would not go further. That is, the output is like:
    Thread 2 would notify the threads blocked on lock.
    Thread 1 go on.
    But the String, "Thread 2 go on." would not be printed out.
    It was so strange, and I repeated for tens of times, it always occurred here and there.
    Is it a bug of java?

    There seems to be nothing wrong with this to me:
    You should use better debugging messages. I couldn't read it the way you had it.
    public class BugThread extends Thread
        Object lock;
        Notifier notifier;
        public static void main(String[] arg)
            for(int i = 0; i < 5; i ++)
                Object lock = "lock " + i;
                Notifier noti = new Notifier(lock);
                BugThread bug = new BugThread(lock, noti);
                bug.start();
                noti.start();
        public BugThread(Object lock, Notifier notifier)
            this.lock = lock;
            this.notifier = notifier;
        public void run()
            int i = 0;
            while( i++ < 100)
                synchronized(lock)
                    System.out.println("Bug thread: "
                        + lock + " would block at Object: "
                        + lock);
                    try
                        lock.wait();
                    catch(InterruptedException ex)
                        ex.printStackTrace();
                    System.out.println("Bug thread: "
                        + lock + " unblocked at Object: "
                        + lock);
            notifier.stop();
    class Notifier extends Thread
        Object lock;
        public Notifier(Object lock)
            this.lock = lock;
        public void run()
            int i = 0;
            while(true)
                synchronized(lock)
                    System.out.println("Notifier: " + lock
                        + " would notify Bugthread blocking at object: "
                        + lock.toString() + ". time no." + i);
                    lock.notifyAll();
                    System.out.println("Notifier: " + lock
                        + " notified bugthread. time no." + i);
                System.out.println("Notifier: " + lock
                    + " go on working. time no." + i);
                i ++;
    }

  • ESS _ Total compensation statement not viewed

    Hi All,
    Total compensation statement is viewed fine in development portal, but when I have all the transports mmoved to Q and started testing I am getting a message that ' Error displaying form'.
    Has any body encountered this kind of problem ? Can any body please tell me what I should be missing.
    We are on ECC 5.0.
    Thanks in advance.
    Srinivas

    Did you transport all of their component, like the form style, etc.?
    Also check T77S0, to see what form is it looking for? In there you can specify what form it uses
    Total Compensation Statement reads off the payroll cluster, are you doing in house payroll?

  • Wait and notify in Object

    Hi,
    Who can give me a short java code segment to show the method wait and notify of the class Object.
    I've already tryed as forlow:
    try {
    A a = new A();
    a.wait() ;
    catch (InterruptedException ex) {
    ex.printStackTrace() ;
    But a thread is always be thrown:
    java.lang.IllegalMonitorStateException: current thread not owner
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:420)
         at A.main(A.java:34)
    Who can tell which thread should be the owner thread? I did realize noly one thread there.
    Thanks a million.

    The classic example is two threads, on adding items to a queue and one taking them off and processing them:
    // consumer
    Object item = null;
    do {
       synchronized(queue) {
          if(queue.isEmpty())
              queue.wait();
        item = queue.remove(0);
      // process item
      } while(!Thread.currentThread.isInterrupted());
    // producer
    synchronized(queue) {
        if(queue.isEmpty())
          queue.notify();
       queue.add(item);
       }The use of synchronized blocks or methods is essential. They guard against conflicts and race conditions between different sections that change the same data.

Maybe you are looking for