Thread scheduling mechanism in SUN's VM

I've the problem, that n threads share a resource
(sharedObject).
The synchronization is done in an synchronized
Block:
synchronized( sharedObject )
// do something with sharedIbject
I would like to know in which order the thread scheduler
of SUN Solaris VM of the JDK 1.3 or in general,
gives the lock of the sharedObject to one of the thread, which
are waiting for the lock of the sharedObject.
Is there something like FIFO, so that it's safe, that all waiting
threads will get the sharedObject in the right order,
or do i have to implement a queueing mechanism with wait and
notify.
thanks

If you're writing a Java program that uses threads, the thing to do is to follow the rules that Java provides, not the rules of a particular thread scheduler.
There is no guarantee about which order the threads will get access to the sharedObject without writing explicit code for it.

Similar Messages

  • Sol 9 thread scheduling

    I posted this yesterday in the kernel forum because thread scheduling seemed more like a kernel issue than the generally admin type things usually discussed here, but I've not had any takers in kernel, so I'm trying here. Basically, while porting an application from solaris 8 to solaris 9, I seem to have run into a starvation issue with the new 1x1 thread model.
    Here is a link to the post in the kernel forum:
    http://forum.sun.com/thread.jsp?forum=10&thread=18592&tstart=0&trange=100
    Any help would be appreciated.

    I wonder why results were same. I replaced sleep(10) with an arbitrary number of busy loops, 100000
    I do see that all threads get a chance to run. I am running a 2 CPU ultrasparc each running at 1002 MHz. I do not have an understanding of your application though, but as others mentioned feel that mutexes should be used to protect critical sections (which would be small) or as a mechanism to wakeup in an async manner along with condition variables.
    pthread_starvation: press ^C to interrupt.
    Thread 6 waited 0 milliseconds.
    Thread 11 waited 5 milliseconds.
    Thread 10 waited 5 milliseconds.
    Thread 9 waited 6 milliseconds.
    Thread 8 waited 6 milliseconds.
    Thread 7 waited 7 milliseconds.
    Thread 2 waited 7 milliseconds.
    Thread 3 waited 7 milliseconds.
    Thread 4 waited 8 milliseconds.
    Thread 5 waited 8 milliseconds.
    Thread 6 waited 0 milliseconds.
    Thread 11 waited 0 milliseconds.
    Thread 10 waited 0 milliseconds.
    Thread 9 waited 0 milliseconds.
    Thread 8 waited 0 milliseconds.
    Thread 7 waited 0 milliseconds.
    Thread 2 waited 0 milliseconds.
    Thread 3 waited 0 milliseconds.
    -madhusudan

  • IS a thread scheduler part of JVM or OS ?

    Hi Folks,
    Just curious if the thread scheduler is a part of the JVM or OS, or either or both ?
    I tried few thread pages in JLS,but couldnot locate the exact sentence describing this.
    However some other resources have given me contradicting information.
    For example, [Reference1|http://www.deitel.com/articles/java_tutorials/20051126/JavaMultithreading_Tutorial_Part3.html] states that it is a part of the OS,whereas [Reference2|http://book.javanb.com/java-threads-3rd/jthreads3-CHP-9-SECT-1.html] states that it is a part of both.(I am not sure about the authority of these links.)
    So assuming, thread scheduling is done by JVM it is a part of the JVM only or it uses the underlying OS for support.
    Thank you for the consideration.

    This statement:
    The JVM ... operates like a mini OS and schedules its own threads regardless the underlying operating system.flatly contradicts this statement:
    In some JVMs, the java threads are actually mapped to native OS threads.They cannot both be true.
    Therefore we can say that Threads are part of JVM and OS bothRubbish. There's no 'therefore' about it. You can't draw valid logical inferences from contradictions.
    Guesswork and invalid inferences aside, the fact of the matter is that the semantics of Java threads are specified in the JLS but the execution mechanism is not. 'Any execution strategy that generates only allowed behaviors is an acceptable execution strategy.'
    I am not sure about the authority of these linksNil. They are extracts from books by third parties. Use at own risk. The JLS is where the authority is.
    Reference 2 is particularly poor, as it contradicts itself numerous times.
    For the record, Reference 2 also makes the following claims which as far as I can see are entirely baseless, for the reasons given:
    A Java virtual machine is required to implement a preemptive, priority-based schedulerThe word 'pre-emptive' does not appear in the JLS.
    The Java virtual machine never changes the priority of a thread, even if the thread has been running for a certain period of timeCan't find that anywhere either.
    the contract between the Java virtual machine and the underlying operating system is that the operating system must generally choose to run the Java thread with the highest priorityThe 'contract' is between the Java code and the JVM, not the JVM and the O/S.
    That's what we mean when we say that Java implements a priority-based schedulerJava isn't required to 'implement' a scheduler at all.
    This scheduler is implemented in a preemptive fashion, meaning that when a higher-priority thread comes along, that thread interrupts (preempts) whatever lower-priority thread is running at the time.This appears nowhere in the JLS.
    The contract with the operating system, however, is not absolute, which means that the operating system can sometimes choose to run a lower-priority thread.In other words it's not pre-emptive. Make up your mind.
    Java's requirement for a priority-based, preemptive scheduling mechanism ...Which is nowhere to be found.
    A Java thread can have one of 11 prioritiesMIN_PRIORITY is 1, MAX_PRIORITY is 10: that makes 10, not 11.
    In fact, preemption means only that a higher-priority thread runs instead of a lower-priority oneNo it doesn't. It means that when a higher-priority thread becomes ready it pre-empts the execution of any lower-priority threads that are currently executing regardless of time-slice etc. This is a feature of real-time systems that Java is not required to implement.
    Summing up, the words 'pre-emptive' does not appear in the JLS, and the word 'scheduler' only appears in reference to sleep() and yield(), without any implication that the JVM has to implement one itself.

  • Thread Scheduling Visualizer - take a look

    Hi,
    I want to share this link with all the sun forum members.
    It is about "The Sun Java Real-Time System Thread Scheduling Visualizer"
    [http://java.sun.com/javase/technologies/realtime/reference/TSV/JavaRTS-TSV.html]
    Sun you are simply too great ;)
    thanks,
    swapnaja
    Edited by: swapnaja on Mar 16, 2009 6:43 AM
    Edited by: swapnaja on Mar 16, 2009 6:48 AM

    Hi,
    Glad it worked for you too. I'm so grateful to 'turboontheovens' for posting this solution, it was driving me crazy!
    Claire x

  • Thread scheduling problem in WLS5.1

    We use a Timer Servlet to schedule some back end tasks, however we found
              that from time to time the thread scheduling often get delayed or ahead in a
              outragous magtitude.
              We run the servlet inside WLS, and right after start up, the timer works
              perfect, but after long enough time (more than one day), the timer started
              to behave weird. It could get delayed for as much as hours, and then
              suddenly fired up all delayed tasks in a very short period of time. We then
              try to run a very simple Timer doing only wake up every 10 minutes and print
              one line, that failed too. We are running WLS5.1+sp3 on
              Solaris2.6(Generic_105181-19 sun4u sparc SUNW,Ultra-5_10) with jdk1.2.1_04.
              BTW, we found that it ran well on NT, at least for three days without
              problem.
              Any feedback will be appreciated!
              Qingxiang Ke
              below is the source for the simple timer, and deploy properties for it
              inside weblogic.properties file.
              SimpleTimerServlet.java
              package com.cysive.test;
              import java.io.*;
              import java.util.*;
              import javax.servlet.*;
              import javax.servlet.http.*;
              public class SimpleTimerServlet extends HttpServlet
              class Sleepy implements Runnable
              public void run()
              while(true)
              try
              long wakeUpTime = 600 * 1000;
              Thread.currentThread().sleep(wakeUpTime);
              System.out.println(new Date().toString() + " SimpleTimer Yawn
              ............ Yawn ............");
              catch(InterruptedException ie){}
              private static boolean timerIsRunning = false;
              public void init()
              if(! timerIsRunning)
              Thread sleepy = new Thread(new Sleepy());
              sleepy.start();
              timerIsRunning = true;
              public void doGet(HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException
              doPost(request, response);
              public void doPost(HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException
              OutputStream os = response.getOutputStream();
              os.write("look at your std out!!!".getBytes());
              os.flush();
              os.close();
              deploy properties in weblogic.properties
              weblogic.httpd.register.simpletimer=com.cysive.test.SimpleTimerServlet
              weblogic.system.startupClass.servletSimpleTimer=weblogic.servlet.utils.Servl
              etStartup
              weblogic.system.startupArgs.servletSimpleTimer=servlet=simpletimer
              

    We use a Timer Servlet to schedule some back end tasks, however we found
              that from time to time the thread scheduling often get delayed or ahead in a
              outragous magtitude.
              We run the servlet inside WLS, and right after start up, the timer works
              perfect, but after long enough time (more than one day), the timer started
              to behave weird. It could get delayed for as much as hours, and then
              suddenly fired up all delayed tasks in a very short period of time. We then
              try to run a very simple Timer doing only wake up every 10 minutes and print
              one line, that failed too. We are running WLS5.1+sp3 on
              Solaris2.6(Generic_105181-19 sun4u sparc SUNW,Ultra-5_10) with jdk1.2.1_04.
              BTW, we found that it ran well on NT, at least for three days without
              problem.
              Any feedback will be appreciated!
              Qingxiang Ke
              below is the source for the simple timer, and deploy properties for it
              inside weblogic.properties file.
              SimpleTimerServlet.java
              package com.cysive.test;
              import java.io.*;
              import java.util.*;
              import javax.servlet.*;
              import javax.servlet.http.*;
              public class SimpleTimerServlet extends HttpServlet
              class Sleepy implements Runnable
              public void run()
              while(true)
              try
              long wakeUpTime = 600 * 1000;
              Thread.currentThread().sleep(wakeUpTime);
              System.out.println(new Date().toString() + " SimpleTimer Yawn
              ............ Yawn ............");
              catch(InterruptedException ie){}
              private static boolean timerIsRunning = false;
              public void init()
              if(! timerIsRunning)
              Thread sleepy = new Thread(new Sleepy());
              sleepy.start();
              timerIsRunning = true;
              public void doGet(HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException
              doPost(request, response);
              public void doPost(HttpServletRequest request,
              HttpServletResponse response)
              throws IOException, ServletException
              OutputStream os = response.getOutputStream();
              os.write("look at your std out!!!".getBytes());
              os.flush();
              os.close();
              deploy properties in weblogic.properties
              weblogic.httpd.register.simpletimer=com.cysive.test.SimpleTimerServlet
              weblogic.system.startupClass.servletSimpleTimer=weblogic.servlet.utils.Servl
              etStartup
              weblogic.system.startupArgs.servletSimpleTimer=servlet=simpletimer
              

  • Thread scheduling

    Hi, I have some questions bout threads.
    1) When it comes to thread scheduling, Java has no say in it, since thread scheduling is solely in a domain of operating system?
    2)In preemptive environment, when thread with higher priority becomes runnable, runtime will cause lower priority thread to halt and higher priority thread to start executing. This chosen thread will run until one of the following conditions is true:
    - a higher priority thread becomes "Runnable"
    - it yields, or its run() method exits
    - on systems that support time-slicing, its time has expired
    a) Time slicing doesn't mean that every thread will get the same amount of time to run?
    b)Will higher priority threads get more time and lower less!
    c) Does Windows OS support time slicing?
    3)What kind of environment is non-preemptive environment? The kind where threads with higher priority cant preempt lower priority threads? As I understand it, in those kind of environments there is a greater chance that some threads will never run. Why?
    4)Why is under non-preemptive environment greater chance of having situation where one of the two threads with same priority will not get a chance to run?
    bye

    beginprog wrote:
    1) When it comes to thread scheduling, Java has no say in it, since thread scheduling is solely in a domain of operating system?This is not strictly true. You can control when a thread is eligible to run, but you can't force a partiular thread to run. The JVM has some control over thread scheduling, but yes, it also interacts with the OS.
    2)In preemptive environment, when thread with higher priority becomes runnable, runtime will cause lower priority thread to halt and higher priority thread to start executing. This chosen thread will run until one of the following conditions is true:
    - a higher priority thread becomes "Runnable"
    - it yields, or its run() method exits
    - on systems that support time-slicing, its time has expired I don't think Java makes any such promises about its threads' priorities. You may be describing a general model, but in terms of the JVM scheduling its threads, higher priority threads will be preferred over lower priority ones, but the exact algorithm is left up to the implementation.
    a) Time slicing doesn't mean that every thread will get the same amount of time to run? There are many ways to implement time slicing. It depends on the VM implementation and the OS.
    b)Will higher priority threads get more time and lower less!Depends on the implementation.

  • Thread Scheduling Query

    Hi,
    If i have 3 messages A, B and C which are in a queue and are to pass through a synchronized method Y . A particular thread X picks 1 message each from the queue and spawns a thread for each of 3.
    A is executing Y and B and C are in BLOCKING State and waiting for A to finish so that they can enter Y.
    Is it possible that C executes first before B.
    Pls advice.
    Thnx in Adv
    Amandeep

    Setting a thread's priority is not the preferred solution namely because it is dangerously inconsistent. The only time to use thread priority is when you have tasks that do not have scheduling conflicts like this and you really don't care when a particular thread runs. As an example the garbage collection thread in a VM is normally a lower priority thread until such time that garbage collection is needed.
    The preferred solution for thread scheduling and order of executing issues is to revisit the design.
    In the example given by the OP I would first question the use of multiple threads at all. It seems that the OP wished tasks to be executed from a queue in the same order as they were added to the queue and that tasks later in the queue should not finish execution before ones earlier.
    This does not seem a good use for multiple threads because this requirement seems to call for anything but parallel execution.
    But perhaps I am reading too much into that statement. I would suggest a revist of the design though to look at doing the following.
    Launcher thread
    1) Gets next thing from queue
    2) Calls synchonized Y method (that no longer needs to be synchronized probably) using thing from queue
    3) Starts new thread with results from Y
    4) Go back to 1
    This design garauantees at least that the launcher threads will be started (and past the synchronized method) in the same order as they were received.
    Does that mean they will complete execution in the same order? No. Does it mean they will actually start processing in the same order? No. But it does mean they will call Y in the same order and since I would guess that is the real issue here it solves the problem.
    If the threads really must finish in the same order than one must consider either; not running seperate threads as I mentioned earlier or adding a semaphore at the end of the spawned "worker" threads so that they wait for previous threads to finish before exiting.

  • Question about synchronize() statement and thread scheduling?

    I have threads accessing a shared LinkedList in the main thread. I made use of the Collections.synchronizedList() to avoid concurrent modifications. one of the threads is a timer thread and it has a priority of 5 and the other threads are message reception threads and i made them of a lower priority just to allow the timer thread to be executed on time. According to the javaAPI, all iterations on the synchronized list should be done using synchronized(synchronizedListRef){} and this is what i do,
    The problem is even after setting the priority of the reception threads lower than the timer thread, the reception threads are sometimes executed more than once and the timer thread is delayed. Lets assume the situation where the timer reaches the point where it has to acquire the lock (the synchronized statement) and it discovers that the lock is already taken and it cant access the list because the other thread (of a lower priority) is iterating over it. shouldnt the higherpriority thread be executed after that the reception thread (that is blocking the timer thread) finishes its execution and release the lock (even if there are other reception thread waiting)??
    does the priority play a role when a thread is blocked?

    Asady wrote:
    I have threads accessing a shared LinkedList in the main thread. I made use of the Collections.synchronizedList() to avoid concurrent modifications. Make sure you explicitly sync around all iterations. Just using Collections.sync is not enough.
    The problem is even after setting the priority of the reception threads lower than the timer thread, the reception threads are sometimes executed more than once and the timer thread is delayed.There's no guarantee as to how priority will be interpreted. The scheduler implementation is free to do pretty much anything.
    As for how to solve your problem, you might want to look at java.util.concurrent.*, e.g. PriorityQueue. If the classes there don't give you just what you need, you may be able to build on them, or at least get ideas from them. Bottom line is that if you want a specific scheduling algorithm, you'll have to implement it yourself, since Threads' priority semantics are only very loosely specified by the JLS.

  • How does Thread scheduling Work

    Hi to all out there. I have been deweloping a program that is supposed to create a Sceduling Thread that would have the higest priorety and manage three more threads. The sceduler creates a CircularList class to call and run each of the other three threads.
    Unfortunatly there are two errors that I can't trace down. If there is any one out there familiar with OS progming I would apreciate a few comments on the following code:
    import java.lang.*;
    public class TestScheduler
         public static void main (String args[])
              Thread.currentThread().setPriority(Thread.MAX_PRIORITY); //Sets Sceduler Priorety
              Scheduler CPUScheduler = new Scheduler();
              CPUScheduler.start();
    /*creates The three other threads to be managed*/
              Thread t1 = new TestThread();
              t1.start();
              //CPUScheduler.addThread(t1);
              Thread t2 = new TestThread();
              t2.start();
              Thread t3 = new TestThread();
              t3.start();
    class Scheduler extends Thread
         public Scheduler(){
              timeSlice = DEFAULT_TIME_SLICE;
    //creates the queues for threads
              queue = new CircularLi();
         public Scheduler(int quantum){
                   timeSlice = quantum;
                   queue = new CircularList();
         public void addThread(Thread t){
                   t.setPriority(2);
    //Error 1 here. Can't recognize the .addItem() method?
                   queue.addItem(t);
         private void schedulerSleep(){
                   try{
                        Thread.sleep(timeSlice);
                   }catch(InterruptedException e){};
         public void run(){
              Thread current;
              this.setPriority(6);
              while (true){
    //Error 2 is here. It sais it can't find a method .getNext()?
                   current = (Thread)queue.getNext();
                   if ((current != null) && (current.isAlive())){
                        current.setPriority(4);
                        schedulerSleep();
                        current.setPriority(2);
         private CircularList queue;
         private int DEFAULT_TIME_SLICE = 100;
         private int timeSlice;
    class TestThread extends Thread
         public void run()
              Total = 0;
              Total++;
              System.out.println("This ran for: " Total " times.");
         public int Total;
    class CircularList extends Scheduler
         public void run ()
              Thread.currentThread().setPriority(5);
              while(true)
                   if(Total < 5)
                        new TestThread().start();
                        Total++;
                   else
                        Thread.currentThread().setPriority(2);
                        Total = 0;
         private int Total = 0;
    Is there another library class I do not know about or do I have to write this methods myself?

    Where have you got the CircularList from?
    it is not part of the java API ... so who ever wrote it should be able to answer your question.
    If it sticks to the conventions of the collection API
    the method addItem is probably simply named add
    and instead of queque.next() you use an iterator instead like this:
    Iterator iter = queque.iterator();
    while (iter.hasNext()){
    Object o = iter.next();
    // do something with o
    HTH
    Spieler

  • Some kind of thread scheduling lag in 6.1sp2

    I've got a 2000sp4 box with Web Server 6.1sp2 installed. I'm running ColdFusion MX as well. The machine is a dual-P4 3.2Ghz. with 4gb of RAM.
    What I'm seeing is at random times, a user will request a page, and then be stuck waiting for a long time (think 10-30 seconds on average). Then, the next page request will load immediately.
    The connection queue is peaking at like 6 connections. It's not a connection queue issue. Iny my performance monitor, when these 'lag spikes' hit, as they come down, I see our ColdFusion process take on a spike in requests, as if during this 'lag spike' all the connections get stuck somewhere and, once cleared, they all go through at once.
    Both the ColdFusion and Sun One performance monitors show average request/response time at about 100ms.
    I've tested this on a dev machine and seen that the Sun One performance monitor does include CF processing time in the "Total Response Time" that gets reported.
    So since I'm only seeing about 150ms max for the "Total Response Time", that would seem to indicate my 'lag spike' is something that occurs at the point connections are accepted.
    The 'lag spikes' are not limited to requests for CF pages. Images, static files, and even the performance monitor are susceptible to these 'lag spikes'.
    One symptom that might be worth pointing out is that if I hit a 'lag spike' and simply stop my request, then re-request it (hit the reload button) the page will come up immediately.
    There are 8 virtual servers on the box, each has only 1 acceptor thread. I see these lag spikes on virtual servers that have nobody else but myself connecting to them, so I don't think it's an acceptor thread issue.
    KernelThreads is set to ON as setting it to OFF seems to make the web server virtually unresponsive.
    NativePool:
    Idle/Peak/Limit 1/1/64
    Work Queue Length/Peak/Limit 0/0/256
    I have never see the idle/peak values go above 1 for my NativePool. Is this "normal"? I do not have CF running in a separate thread pool.
    Does anyone have any ideas or suggestions?
    Thanks

    A couple of things.
    First, thanks for the tips. I was starting to suspect the network might be an issue (bad nic, bad router, something).
    But netstat -s was showing an average of about .15% packet loss. For a web server that seems to be a pretty good value so I'm not sure.
    I did, however, ask someone else to look at the server because I'd spent the whole week on just server performance and was going out of my mind. This second pair of eyes really helped as he found that the pagefile for the server was set at 2mb!? Still trying to figure out how that happened. But we increased the pagefile to a much better value. There wasn't an immediate change in performance, but over time the server appears to have begun to respond better.
    Occasionally I still get these 'lag spikes' but nowhere near what they were and the delay is much smaller as well, which is probably being caused by something else entirely (like bad programming on my part, hah).

  • Solaris 9 vs 10 wrt process/thread scheduling, from perspective of 'top'

    On a dual-processor UltraSpract Fire V240, running Solaris 9, the 'top' command shows:
    rodan%top
    load averages:  2.43,  2.23,  2.23                                 00:41:10
    39 processes:  35 sleeping, 2 running, 2 on cpu
    CPU states:     % idle,     % user,     % kernel,     % iowait,     % swap
    Memory: 2048M real, 1707M free, 160M swap in use, 2500M swap free
      PID USERNAME THR PRI NICE  SIZE   RES STATE   TIME    CPU COMMAND
    1551 ssgolsha   1   0    0   62M   61M run   324:17 46.89% vpr
    1866 ssgolsha   1   0    0   22M   20M run    41:57 45.19% vpr
    1922 mingl      4   0    0   42M   39M cpu0    1:28  6.27% messengers
    1928 mingl      1  39    0 1640K 1208K cpu1    0:00  0.12% top-sun4u-5.7
      185 root       3  59    0 4920K 3352K sleep   0:14  0.02% automountd
    1583 mingl      1  49    0 3584K 3136K sleep   0:00  0.02% tcshrodan%top
    load averages:  2.77,  2.51,  2.35                                 00:41:45
    39 processes:  35 sleeping, 2 running, 2 on cpu
    CPU states:  0.0% idle, 99.8% user,  0.2% kernel,  0.0% iowait,  0.0% swap
    Memory: 2048M real, 1707M free, 160M swap in use, 2500M swap free
      PID USERNAME THR PRI NICE  SIZE   RES STATE   TIME    CPU COMMAND
    1866 ssgolsha   1   0    0   22M   20M run    42:23 38.18% vpr
    1551 ssgolsha   1   0    0   62M   61M run   324:38 33.02% vpr
    1922 mingl      4   0    0   42M   39M cpu1    1:51 28.34% messengers
    1928 mingl      1  59    0 1640K 1280K cpu0    0:00  0.02% top-sun4u-5.7
      185 root       2  59    0 4920K 3352K sleep   0:15  0.00% automountd
      219 root      19  59    0 4760K 3552K sleep   0:03  0.00% nscd
    1583 mingl      1  59    0 3584K 3136K sleep   0:00  0.00% tcshSunOS 5.9's man page for 'top' says STATE is the current state (one of "sleep", "WAIT", "run", "idl", "zomb", or "stop")
    On a dual-processor dual-core AMD Opteron 270, running Solaris 10, the 'top' command shows:
    homer% top
    load averages:  0.11,  0.16,  0.12;                    up 7+08:19:46    17:11:47
    93 processes: 91 sleeping, 2 on cpu
    CPU states: 72.3% idle, 25.1% user,  2.5% kernel,  0.0% iowait,  0.0% swap
    Memory: 2048M phys mem, 1606M free mem, 8001M swap, 7873M free swap
       PID USERNAME LWP PRI NICE  SIZE   RES STATE    TIME    CPU COMMAND
    14685 mingl      4  30    0  112M  109M cpu      2:09   105% messengers
       258 root       1  59    0   13M 5260K sleep   74:52  0.70% Xorg
      9522 coby       1  59    0   47M 8116K sleep   22:44  0.33% mixer_applet2
      9520 coby       1  59    0   49M 8592K sleep    6:35  0.12% gnome-netstatus
       270 gdm        1  59    0   50M 6076K sleep    4:44  0.08% gdmgreeter
    14658 mingl      1  59    0 2068K 1488K cpu      0:00  0.08% top
    SunOS 5.10's man page for 'top' says
    STATE
    Current state (typically one of "sleep", "run", "idl", "zomb", or "stop").
    As seen in both cases, the 'messengers' program has 4 threads.
    On Solaris 9, its state is either cpu0 or cpu1, depending on the time I call 'top'. Does that mean it is actually running on either cpu0 or cpu1? What is the difference between the 'cpu0' state and the 'run'
    state? And does it mean all 4 threads are running/assigned to cpu0 (or cpu1)?
    On Solaris 10, the state shows 'cpu'. Does it mean it is running? And does it mean that each thread may run on a different CPU therefore the state does not show any particular CPU number? Is it correct that Solaris 9 assign the CPU on a per-process basis and Solaris 10 on a per-thread basis?

    On Solaris 9, its state is either cpu0 or cpu1,
    depending on the time I call 'top'. Does that mean
    it is actually running on either cpu0 or cpu1?Should be.
    What
    is the difference between the 'cpu0' state and the
    'run' state?A thread can be sleeping (it doesn't have anything to do), or runnable. Although it's runnable, it doesn't mean that it's running right at that instant.
    Note that it's difficult to get a good view of the situation with 'top' (or almost any other program). Because whenever 'top' looks, 'top' will always be running, even though it's only running a fraction of the time.
    And does it mean all 4 threads are
    running/assigned to cpu0 (or cpu1)? No. Each thread is independently executed. But since you only have 2 processors, and since 'top' has to be running when it runs, you'll only ever see your process on at most one other cpu.
    You might want to use 'prstat' and 'prstat -L'. The first shows one line per process, the second one line per thread.
    On Solaris 10, the state shows 'cpu'. Does it mean
    it is running? And does it mean that each thread may
    run on a different CPU therefore the state does not
    show any particular CPU number? Is it correct that
    Solaris 9 assign the CPU on a per-process basis and
    Solaris 10 on a per-thread basis?I don't know exactly what top does or doesn't do. You might try 'prstat' instead.
    There is no difference at this level between Solaris 9 and 10. All will schedule on a per-thread basis.
    Darren

  • Thread number limitation on Sun One Web Server 6.1 on Solaris 9

    Hi.
    I am testing my servlet on Web Server 6.1 on Solaris 9 (SPARC). I am logging start of HTTPServlet.doPost() method and end of it, by calling GenericServlet.log() method for perfomance check.
    When I request more than two request(it takes long time) simultaneously from browser, my servlet logs like:
    doPost start
    doPost start
    doPost end
    doPost start
    doPost end
    doPost start
    :that is ,two requests is processed concurrent by threads, and another requests waiting, and after each running thread ends, waiting request is processed one by one.
    I think there is some limitation of thread or connections, so I checked magnus.conf. But RqThrottle is set to 128. And I cannot find any thread number settings.
    My magnus.conf is as follows.
    # The NetsiteRoot, ServerName, and ServerID directives are DEPRECATED.
    # They will not be supported in future releases of the Web Server.
    NetsiteRoot /export/home0/SUNWwbsvr
    ServerName test03
    ServerID https-test03
    RqThrottle 128
    DNS off
    Security off
    PidLog /export/home0/SUNWwbsvr/https-test03/logs/pid
    User webservd
    StackSize 131072
    TempDir /tmp/https-test03-8ac62f09
    UseNativePoll off
    PostThreadsEarly on
    KernelThreads off
    Init fn=flex-init access="$accesslog" format.access="%Ses->client.ip% - %Req->vars.auth-user% [%SYSDATE%] \"%Req->reqpb.clf-request%\" %Req->srvhdrs.clf-status% %Req->srvhdrs.content-length%"
    Init fn="load-modules" shlib="/export/home0/SUNWwbsvr/bin/https/lib/libj2eeplugin.so" shlib_flags="(global|now)"Why web server do not process more than two requests concurrent? Which server configuration should I check?
    Thanks in advance.

    I don't think I ever ran into that kind of a limit. Does the servlet use database connections (maybe the connection pool is empty) or other critical sections / large synchronized blocks?
    Try a minimal servlet that takes a while to execute:
        doGet(...)
            log("sleep starting " + Thread.currentThread().getName());
            try {
                Thread.sleep(30000);
            } catch (Exception e) { }
            log("sleep done " + Thread.currentThread().getName());
            response.getOutputStream().println("good morning");

  • Thread scheduling with Windows XP pro 64

    I am using JDK SE 5.0 update 7 with the eclipse IDE on Windows XP pro-64bit. Windows is a virtual machine running via VM-ware with Linux as the host OS.
    The basic function of my app is to recieve data from a socket via a listener (3rd party software). When data is available, it gets written to a list. (this is thread 1)
    My app has another thread (thread 2) of equal, default priority which tests the list for data. If there i data, it removes the oldest data and does some processing. (parse and print for example). My problem lies in that using this OS thread 2 seems to be using all the cpu and giving thread 1 little, if any cpu time. It seems like this OS isn't implementing timeslicing. I inserted a yield() in thread2 which helps, but the software still runs slow as a whole (I think thread2 is still hogging cpu).
    I have ran the same code on Win XP Pro -32 bit, as well as Linux without any yeilding or sleeping, and the program run super fast as if the timeslicing, round-robin is working great.
    My question is, does anyone know of any idiosynchracy of Windows XP pro-64 bit, or java that could be causing this? Any suggestions on how to fix it?
    Thanks,

    My app has another thread (thread 2) of equal, default priority which tests the list for data. If there i data,
    And if there's no data? I hope you don't do busy waiting, do you?
    (If so: Instead of busy waiting you shoud use a ArrayBlockingQueue or something like this.)

  • Installation of the Thread Scheduling Visualizer (TSV)

    Hi,
    I've already written some realtime applications and now I want to monitor them via TSV. I've downloaded RTS 2.1 with TSV and installed RTS 2.1. I guess TSV isn't installed yet (command "drecord" is not known by solaris). So I think TSV is inside the file "threadsc.gz", isn't it? I've already extracted this file, but still I don't know, how to install TSV.
    I've already read the TSV Guide, but there are only very poor informations on the installation of it.
    So can anyone explain to me, what the name of the TSV installation file is and how I can install it on Solaris?
    Thanks a lot!

    Hi Gordon:
    TSV can be downloaded when you download the Java RTS 2.1 eval on
    Solaris; just to be clear, TSV is based on DTrace (a Solaris specific
    tool), hence it's not available for Linux. When you go through the Java
    RTS 2,1 eval download process for Solaris (either x86 or SPARC version),
    you will see the TSV download link listed on the final page (after having
    taken the survey and agreeing with the eval license) -- it's the same
    page as the one that also lists the Java RTS 2.1 eval download link.
    The name of the TSV bundle on that page is "tsv-1.2.tar.gz". All you
    need to do to install this is to unpack it.
    HTH,
    -Carlos Lucasius
    http://sites.google.com/site/javartsandjavaseforembedded/

  • Large Memory Usage and Frozen [thread dump attached]

    Hi,
    SQL Developer (Version 2.1.1.64, WinXP Pro, Java 1.6, Oracle 10g R2) always uses at least 550MB of memory, if left open, for more than a day, it invariably goes up to 700-800MB.
    If I close all windows and connections, virtually no memory is reclaimed.
    I clicked + beside a view to see the columns, sqldeveloper froze for a few minutes, below is the thread dump.
    2010-05-21 11:31:58
    Full thread dump Java HotSpot(TM) Client VM (14.2-b01 mixed mode):
    "CONNECTION_ALIVE" prio=6 tid=0x3891c000 nid=0x1d58 waiting for monitor entry [0x3a55f000]
    java.lang.Thread.State: BLOCKED (on object monitor)
    at oracle.jdbc.driver.T4CConnection.doPingDatabase(T4CConnection.java:3398)
    - waiting to lock <0x09ad05f8> (a oracle.jdbc.driver.T4CConnection)
    at oracle.jdbc.driver.PhysicalConnection.pingDatabase(PhysicalConnection.java:7074)
    at oracle.javatools.db.ora.BaseOracleDatabase.isConnectionAlive(BaseOracleDatabase.java:165)
    at oracle.javatools.db.AbstractDatabase$1.run(AbstractDatabase.java:316)
    at java.lang.Thread.run(Thread.java:619)
    "Loading Children" prio=6 tid=0x3891bc00 nid=0x12c4 waiting on condition [0x39d5f000]
    java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x03eab570> (a java.util.concurrent.FutureTask$Sync)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:747)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:905)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1217)
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:218)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$IdeTaskTracker.run(RaptorTaskManager.java:532)
    at java.lang.Thread.run(Thread.java:619)
    "pool-2-thread-57" prio=6 tid=0x3891b400 nid=0x2094 waiting on condition [0x35b5f000]
    java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x09b819f0> (a java.util.concurrent.locks.ReentrantLock$NonfairSync)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireNanos(AbstractQueuedSynchronizer.java:841)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireNanos(AbstractQueuedSynchronizer.java:1160)
    at java.util.concurrent.locks.ReentrantLock.tryLock(ReentrantLock.java:416)
    at oracle.dbtools.raptor.utils.Connections.lock(Connections.java:1334)
    at oracle.dbtools.raptor.utils.Connections.lock(Connections.java:1319)
    at oracle.dbtools.raptor.utils.Connections.lock(Connections.java:1306)
    at oracle.dbtools.raptor.navigator.xml.AbstractItemInstance.lockConnection(AbstractItemInstance.java:52)
    at oracle.dbtools.raptor.navigator.xml.XmlNodeInstance.listChildren(XmlNodeInstance.java:55)
    at oracle.dbtools.raptor.navigator.ObjectNodeFilter$ObjectNodeFilterLoadTask.doWorkImpl(ObjectNodeFilter.java:78)
    at oracle.dbtools.raptor.navigator.DeferredLoadingFilter$FilterLoadTask.doWork(DeferredLoadingFilter.java:124)
    at oracle.dbtools.raptor.navigator.DeferredLoadingFilter$FilterLoadTask.doWork(DeferredLoadingFilter.java:113)
    at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:193)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:492)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    "pool-2-thread-55" prio=6 tid=0x38d68400 nid=0xd74 runnable [0x3a15f000]
    java.lang.Thread.State: RUNNABLE
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at oracle.net.ns.Packet.receive(Packet.java:239)
    at oracle.net.ns.DataPacket.receive(DataPacket.java:92)
    at oracle.net.ns.NetInputStream.getNextPacket(NetInputStream.java:172)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:117)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:92)
    at oracle.net.ns.NetInputStream.read(NetInputStream.java:77)
    at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1023)
    at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:999)
    at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:584)
    at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:194)
    at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:785)
    at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:860)
    at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
    at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
    at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3425)
    - locked <0x09ad05f8> (a oracle.jdbc.driver.T4CConnection)
    at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1490)
    at oracle.dbtools.raptor.controls.grid.ResultSetTableModel.openResultSet(ResultSetTableModel.java:412)
    at oracle.dbtools.raptor.controls.grid.ResultSetTableModel.fetchNext(ResultSetTableModel.java:169)
    at oracle.dbtools.raptor.controls.grid.ResultSetTableModel$4.doWork(ResultSetTableModel.java:556)
    at oracle.dbtools.raptor.controls.grid.ResultSetTableModel$4.doWork(ResultSetTableModel.java:540)
    at oracle.dbtools.raptor.backgroundTask.RaptorTask.call(RaptorTask.java:193)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$RaptorFutureTask.run(RaptorTaskManager.java:492)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    "AWT-EventQueue-0" prio=6 tid=0x354fac00 nid=0x18d4 waiting for monitor entry [0x3a45f000]
    java.lang.Thread.State: BLOCKED (on object monitor)
    at oracle.jdbc.driver.PhysicalConnection.getMetaData(PhysicalConnection.java:3891)
    - waiting to lock <0x09ad05f8> (a oracle.jdbc.driver.T4CConnection)
    at oracle.dbtools.raptor.plscope.Query.getToolTipText(Query.java:58)
    at oracle.dbtools.raptor.phighlight.TooltipPlugin$1.getToolTipText(TooltipPlugin.java:29)
    at oracle.ide.ceditor.CodeEditor.getToolTipText(CodeEditor.java:1734)
    - locked <0x17245f98> (a java.util.ArrayList)
    at oracle.javatools.editor.BasicEditorPane.getToolTipText(BasicEditorPane.java:1530)
    at javax.swing.ToolTipManager$insideTimerAction.actionPerformed(ToolTipManager.java:658)
    at javax.swing.Timer.fireActionPerformed(Timer.java:271)
    at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
    "Background Parser" prio=6 tid=0x38a43400 nid=0x23c4 waiting on condition [0x39c5f000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:112)
    at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
    at java.lang.Thread.run(Thread.java:619)
    "SwingWorker-pool-5-thread-1142" prio=6 tid=0x38868800 nid=0x1a7c waiting on condition [0x3820f000]
    java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x0e77bc10> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x38a76c00 nid=0x1d18 waiting on condition [0x3a35f000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:112)
    at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
    at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x387e2800 nid=0xd00 waiting on condition [0x3a25f000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:112)
    at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
    at java.lang.Thread.run(Thread.java:619)
    "Background Parser" prio=6 tid=0x38752000 nid=0x2794 waiting on condition [0x39e5f000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:112)
    at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
    at java.lang.Thread.run(Thread.java:619)
    "Swing-Shell" daemon prio=6 tid=0x367f0000 nid=0xd7c waiting on condition [0x3a85f000]
    java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x1069d0d8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at sun.awt.shell.Win32ShellFolderManager2$ComInvoker$3.run(Win32ShellFolderManager2.java:458)
    at java.lang.Thread.run(Thread.java:619)
    "Persistence Auto Flusher" daemon prio=6 tid=0x388a5c00 nid=0x1950 in Object.wait() [0x37e0f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at java.util.TimerThread.mainLoop(Timer.java:483)
    - locked <0x0e892d48> (a java.util.TaskQueue)
    at java.util.TimerThread.run(Timer.java:462)
    "Thread-76" prio=6 tid=0x387aec00 nid=0x259c runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "WeakDataReference polling" prio=2 tid=0x38752800 nid=0xe94 in Object.wait() [0x3a05f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <0x0b6ba260> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at oracle.ide.util.WeakDataReference$Cleaner.run(WeakDataReference.java:88)
    at java.lang.Thread.run(Thread.java:619)
    "Image Animator 3" daemon prio=4 tid=0x3861b400 nid=0x2330 waiting on condition [0x3978f000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at sun.awt.image.GifFrame.dispose(GifImageDecoder.java:653)
    at sun.awt.image.GifImageDecoder.produceImage(GifImageDecoder.java:230)
    at sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:246)
    at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:172)
    at sun.awt.image.ImageFetcher.run(ImageFetcher.java:136)
    "Background Parser" prio=6 tid=0x38348800 nid=0x978 waiting on condition [0x3988f000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
    at java.lang.Thread.sleep(Native Method)
    at oracle.dbtools.raptor.plsql.BackgroundParser$1.construct(BackgroundParser.java:112)
    at oracle.dbtools.raptor.utils.NamedSwingWorker$2.run(NamedSwingWorker.java:115)
    at java.lang.Thread.run(Thread.java:619)
    "TextBufferScavenger" prio=6 tid=0x38324800 nid=0x1af0 in Object.wait() [0x3968f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <0x09bb9158> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at oracle.ide.model.TextNode$FacadeBufferReference$PollingThread.run(TextNode.java:1949)
    "pool-4-thread-1" prio=6 tid=0x36960400 nid=0x1a84 waiting on condition [0x35a5f000]
    java.lang.Thread.State: TIMED_WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x08150a78> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1963)
    at java.util.concurrent.DelayQueue.take(DelayQueue.java:164)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:583)
    at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:576)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    "IconOverlayTracker Timer" prio=6 tid=0x38520c00 nid=0x1b48 in Object.wait() [0x3950f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at java.util.TimerThread.mainLoop(Timer.java:483)
    - locked <0x0795f290> (a java.util.TaskQueue)
    at java.util.TimerThread.run(Timer.java:462)
    "Timer queue for AWT thread" daemon prio=6 tid=0x369b4000 nid=0x1f20 in Object.wait() [0x3940f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x077e1358> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:485)
    at ice.util.awt.TimedAWTExecutor.nextElem(TimedAWTExecutor.java:108)
    - locked <0x077e1358> (a java.lang.Object)
    at ice.util.awt.TimedAWTExecutor.runScheduler(TimedAWTExecutor.java:130)
    at ice.util.awt.TimedAWTExecutor$1.run(TimedAWTExecutor.java:19)
    "WaitCursor-Timer" prio=6 tid=0x367c3c00 nid=0x1010 in Object.wait() [0x37b0f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at java.util.TimerThread.mainLoop(Timer.java:483)
    - locked <0x077e1400> (a java.util.TaskQueue)
    at java.util.TimerThread.run(Timer.java:462)
    "Native Directory Watcher" prio=2 tid=0x368d4000 nid=0x2334 runnable [0x3830f000]
    java.lang.Thread.State: RUNNABLE
    at oracle.ide.natives.NativeHandler.enterWatcherThread(Native Method)
    at oracle.ide.natives.NativeHandler$2.run(NativeHandler.java:252)
    at java.lang.Thread.run(Thread.java:619)
    "BaseTreeExplorer.NodeOpeningExecutor" prio=6 tid=0x3684b000 nid=0x8b0 waiting on condition [0x3810f000]
    java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <0x06950af0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1925)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:358)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
    at java.lang.Thread.run(Thread.java:619)
    "Scheduler" daemon prio=6 tid=0x36846400 nid=0x14bc in Object.wait() [0x37f0f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at oracle.dbtools.raptor.backgroundTask.TaskLinkedList.takeNextTask(TaskLinkedList.java:47)
    - locked <0x06950c70> (a oracle.dbtools.raptor.backgroundTask.TaskLinkedList)
    at oracle.dbtools.raptor.backgroundTask.RaptorTaskManager$SchedulerThread.run(RaptorTaskManager.java:422)
    "TimerQueue" daemon prio=6 tid=0x36832800 nid=0x88c in Object.wait() [0x37d0f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at javax.swing.TimerQueue.postExpiredTimers(TimerQueue.java:218)
    - locked <0x06950da8> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(TimerQueue.java:234)
    - locked <0x06950da8> (a javax.swing.TimerQueue)
    at java.lang.Thread.run(Thread.java:619)
    "ChangeSetService" prio=2 tid=0x367fd400 nid=0x2754 in Object.wait() [0x37c0f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x06892cc0> (a oracle.jdevimpl.vcs.changeset.ChangeSetService)
    at java.lang.Object.wait(Object.java:485)
    at oracle.jdevimpl.vcs.changeset.ChangeSetService.awaitEvents(ChangeSetService.java:178)
    - locked <0x06892cc0> (a oracle.jdevimpl.vcs.changeset.ChangeSetService)
    at oracle.jdevimpl.vcs.changeset.ChangeSetService.eventLoop(ChangeSetService.java:199)
    at oracle.jdevimpl.vcs.changeset.ChangeSetService.access$200(ChangeSetService.java:56)
    at oracle.jdevimpl.vcs.changeset.ChangeSetService$2.run(ChangeSetService.java:138)
    at java.lang.Thread.run(Thread.java:619)
    "TimedCache-Timer" daemon prio=6 tid=0x35d52c00 nid=0x2448 in Object.wait() [0x3624f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at java.util.TimerThread.mainLoop(Timer.java:483)
    - locked <0x062ab118> (a java.util.TaskQueue)
    at java.util.TimerThread.run(Timer.java:462)
    "JarIndex Timer" daemon prio=6 tid=0x35556400 nid=0x2488 in Object.wait() [0x35d4f000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.util.TimerThread.mainLoop(Timer.java:509)
    - locked <0x062206e0> (a java.util.TaskQueue)
    at java.util.TimerThread.run(Timer.java:462)
    "AWT-Windows" daemon prio=6 tid=0x354dd000 nid=0x1d0c runnable [0x3595f000]
    java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(WToolkit.java:291)
    at java.lang.Thread.run(Thread.java:619)
    "AWT-Shutdown" prio=6 tid=0x354a1800 nid=0x268c in Object.wait() [0x3585f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
    - locked <0x062208d8> (a java.lang.Object)
    at java.lang.Thread.run(Thread.java:619)
    "Java2D Disposer" daemon prio=10 tid=0x354b7400 nid=0x5f4 in Object.wait() [0x3575f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <0x06220968> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at sun.java2d.Disposer.run(Disposer.java:125)
    at java.lang.Thread.run(Thread.java:619)
    "Low Memory Detector" daemon prio=6 tid=0x00ee1000 nid=0x2664 runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "CompilerThread0" daemon prio=10 tid=0x00edc000 nid=0x1f6c waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "Attach Listener" daemon prio=10 tid=0x00eda800 nid=0x206c runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "Signal Dispatcher" daemon prio=10 tid=0x00ed9400 nid=0xf64 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "Finalizer" daemon prio=8 tid=0x00ec6c00 nid=0x2348 in Object.wait() [0x34e7f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
    - locked <0x061b0298> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
    at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=10 tid=0x00ec5800 nid=0x2484 in Object.wait() [0x34d7f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
    - locked <0x061b0320> (a java.lang.ref.Reference$Lock)
    "main" prio=6 tid=0x009f8000 nid=0x19e0 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE
    "VM Thread" prio=10 tid=0x00ec1800 nid=0x22e0 runnable
    "VM Periodic Task Thread" prio=10 tid=0x00eec000 nid=0x2604 waiting on condition
    JNI global references: 5312
    Heap
    def new generation total 45376K, used 28499K [0x03080000, 0x061b0000, 0x061b0000)
    eden space 40384K, 67% used [0x03080000, 0x04af44c0, 0x057f0000)
    from space 4992K, 28% used [0x05cd0000, 0x05e30850, 0x061b0000)
    to space 4992K, 0% used [0x057f0000, 0x057f0000, 0x05cd0000)
    tenured generation total 604992K, used 364537K [0x061b0000, 0x2b080000, 0x2b080000)
    the space 604992K, 60% used [0x061b0000, 0x1c5ae548, 0x1c5ae600, 0x2b080000)
    compacting perm gen total 57344K, used 57260K [0x2b080000, 0x2e880000, 0x33080000)
    the space 57344K, 99% used [0x2b080000, 0x2e86b348, 0x2e86b400, 0x2e880000)
    No shared spaces configured.
    Edited by: mdaly on May 21, 2010 11:42 AM

    The cause of hang could be figured out from the thread dump.
    I have fixed that in development code. It was happening from PL/SQL editor trying to create tooltip which locked up the connection.
    I am not sure what would lead to memory bloat even if the tool is not in use. There could be memory leak from some component. I am investigating that.
    Suggest you to keep ObjectViewers, reports & PL/SQL editor closed when not in use.
    Have Sql Array Fetch Size preference to 50 if it's higher.
    Do not have auto-refresh for Report editor.
    Keep Sql History, Find Db Object, Snippets collapsed.
    See if that helps.
    -Raghu

Maybe you are looking for