Process and thread CPU%

Hello,
Is there a utility to allow me to view CPU usage of my process and its inidividual threads (i.e. not "top").
Thanks,
Neil

tray
sar n
where n is the time period
Ahmed fathy

Similar Messages

  • Understanding asynchronous BPEL processes and threading

    Hi everybody,
    I have a question regarding asynchronous BPEL processes and threading.
    I have an asynchronous BPEL process which delivers a message (picked up from a JMS topic) to a repository (via for instance an ICAN server). This transaction must be time-sensitive, i.e. first-in is first-out.
    If I have several threads running concurrently I have no guarantee that the messages are delivered in the same order that they where generated. It seems that the suggested way around this problem is to use single-threading.
    So here's the part that I do not understand:
    An asynchronous request does not wait for a response. If I use single-threading then what happens to that single-thread if for some reason (for instance the ICAN server is not responding) the BPEL instance is dehydrated? Is the thread still allocated for waiting for the first response or does it go back and pick up the next thing on the topic? If the next thing on the topic is picked up then how can I be sure that the messages are delivered in the correct order? If the thread is still allocated to the single instance then does that not kindda go against the whole concept of an asynchronous process?
    I hope some one can explain this to me.
    Thank you in advance.
    Kind regards,
    Mathias
    PS. This question is an attempt of a different angle on another forum thread: Asynchronuos BPEL - how to get the order of messages right?

    Hi again,
    A quick follow up question:
    Is there any way to have several BPEL processes running on the same server with different settings for how many threads to use?
    It seems that the only way to set number of threads used by BPEL is to use the configuration in the BPEL console? This is an domain setting - which means that all processes deployed to the server is effected the same way?
    I am asking because I am facing a scenario where I need one BPEL process to read from a AQ queue (well actually a topic) with a single thread and another BPEL process - deployed to the same BPEL server - to read from the same AQ queue with multiple threads.
    Does anyone have any idea of how to do this? Can it be done?
    Any suggestions, hints or reference to any documentation would be very much appreciated.
    Thank you in advance,
    Aagaard

  • Process and Thread

    I am new to the servlet and JSP technology.It is said that "Servlets and CGI differ mainly in Process and Thread.CGI used processes and Servlet technology uses Threads".I would like to know what exacly is the meaning of a process and a thread.How do we say that a process uses higher resources and hence a higher resource and memory overhead.
    What do we exactly mean by thread and how r they using less resources?When we say Thread t=new Thread(); what exactly is happening inside?

    A thread runs with in the context of the JVM process.
    http://java.sun.com/docs/books/tutorial/essential/threads/definition.html
    A process is the running of an executable. A cgi can be a C .exe file or a perl script run under perl.exe.
    The thread is faster because the jvm process has been loaded into memory and initialized. For each cgi call the operating system has to load the code into memeory and intialize all the variables and resources.
    http://c2.com/cgi/wiki?CgiVsServlet
    http://www.disc.com/jdbcserv.html

  • Process and threads

    Dear community
    Very kindly pleasant about information that is fiber in thread process and threads it interface between user and application ?
    is this answer on user ask in application run ?
    About any advises who concerns this matter , please .

    Hello RB_1.
    You can find more informations about fibers
    here and
    here on the MSDN Library.
    Bye.
    Luigi Bruno
    MCP, MCTS, MOS, MTA

  • OracleIAS and Information about Process and Threads

    Hi all,
    I need to know information about the running process and threads inside a Conteiner or an Enterprise Application, is it possible?
    Thanks in advance.

    Hi,
    Probably all of mentioned in some extent - depends, which data system needs.
    regards,
    wojciech

  • JDK 1.6 on Solaris. Multiple java processes and thread freezes

    Hi, we've come across a really weird behavior on the Solaris JVM, reported by a customer of ours.
    Our server application consists of multiple threads. Normally we see them all running within a single Java process, and all is fine.
    At some point in time, and only on Solaris 10, it seems that the main Java process starts a second Java process. This is not our code trying to execute some other application/command. It's the JVM itself forking a new copy of itself. I assumed this was because of some JVM behaviour on Solaris that uses multiple processes if the number of threads is > 128. However at the time of spawn there are less than 90 threads running.
    In any case, once this second process starts, some of the threads of the application (incidentally, they're the first threads created by the application at startup, in the first threadgroup) stop working. Our application dumps a list of all threads in the system every ten minutes, and even when they're not working, the threads are still there. Our logs also show that when the second process starts, these threads were not in the running state. They had just completed their operations and were sleeping in their thread pool, in a wait() call. Once the second process starts, jobs for these threads just queue up, and the wait() does not return, even after another thread has done a notify() to inform them of the new jobs.
    Even more interesting, when the customer manually kills -9 the second process, without doing anything in our application, all threads that were 'frozen' start working again, immediately. This (and the fact that this never happens on other OSes) makes us think that this is some sort of problem (or misconfiguration) specific to the Solaris JVM, and not our application.
    The customer initially reported this with JDK 1.5.0_12 , we told them to upgrade to the latest JDK 1.6 update 6, but the problem remains. There are no special JVM switches (apart from -Xms32m -Xmx256m) used. We're really at a dead end here in diagnosing this problem, as it clearly seems to be outside our app. Any suggestion?

    Actually, we've discovered that that's not really what was going on. I still believe there's a bug in the JVM, but the fork was happening because our Java code tries to exec a command line tool once a minute. After hours of this, we get a rogue child process with this stack (which is where we are forking this command line tool once a minute):
    JVM version is 1.5.0_08-b03
    Thread t@38: (state = IN_NATIVE)
    - java.lang.UNIXProcess.forkAndExec(byte[], byte[], int, byte[], int, byte[], boolean, java.io.FileDescriptor, java.io.FileDescriptor, java.io.FileDescriptor) @bci=168980456 (Interpreted frame)
    - java.lang.UNIXProcess.forkAndExec(byte[], byte[], int, byte[], int, byte[], boolean, java.io.FileDescriptor, java.io.FileDescriptor, java.io.FileDescriptor) @bci=0 (Interpreted frame)
    - java.lang.UNIXProcess.<init>(byte[], byte[], int, byte[], int, byte[], boolean) @bci=62, line=53 (Interpreted frame)
    - java.lang.ProcessImpl.start(java.lang.String[], java.util.Map, java.lang.String, boolean) @bci=182, line=65 (Interpreted frame)
    - java.lang.ProcessBuilder.start() @bci=112, line=451 (Interpreted frame)
    - java.lang.Runtime.exec(java.lang.String[], java.lang.String[], java.io.File) @bci=16, line=591 (Interpreted frame)
    - java.lang.Runtime.exec(java.lang.String, java.lang.String[], java.io.File) @bci=69, line=429 (Interpreted frame)
    - java.lang.Runtime.exec(java.lang.String) @bci=4, line=326 (Interpreted frame)
    - java.lang.Thread.run() @bci=11, line=595 (Interpreted frame)There are also several dozen other threads all with the same stack:
    Thread t@32: (state = BLOCKED)
    Error occurred during stack walking:
    sun.jvm.hotspot.debugger.DebuggerException: can't map thread id to thread handle!
         at sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal.getThreadIntegerRegisterSet0(Native Method)
         at sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal.getThreadIntegerRegisterSet(ProcDebuggerLocal.java:364)
         at sun.jvm.hotspot.debugger.proc.sparc.ProcSPARCThread.getContext(ProcSPARCThread.java:35)
         at sun.jvm.hotspot.runtime.solaris_sparc.SolarisSPARCJavaThreadPDAccess.getCurrentFrameGuess(SolarisSPARCJavaThreadPDAccess.java:108)
         at sun.jvm.hotspot.runtime.JavaThread.getCurrentFrameGuess(JavaThread.java:252)
         at sun.jvm.hotspot.runtime.JavaThread.getLastJavaVFrameDbg(JavaThread.java:211)
         at sun.jvm.hotspot.tools.StackTrace.run(StackTrace.java:50)
         at sun.jvm.hotspot.tools.JStack.run(JStack.java:41)
         at sun.jvm.hotspot.tools.Tool.start(Tool.java:204)
         at sun.jvm.hotspot.tools.JStack.main(JStack.java:58)I'm pretty sure this is because the fork part of the UnixProcess.forkAndExec is using the Solaris fork1 system call, and thus all the Java context thinks all those threads exist, whereas the actual threads don't exist in that process.
    It seems to me that something is broken in UnixProcess.forkAndExec in native code; it did the fork, but not the exec, and this exec thread just sits there forever. And of course, it's still holding all the file descriptors of the original process, which means that if we decide to restart our process, we can't reopen our sockets for listening or whatever else we want to do.
    There is another possibility, which I can't completely rule out: this child process just happened to be the one that was fork'd when the parent process called Runtime.halt(), which is how the Java process exits. We decided to exit halfway through a Runtime.exec(), and got this child process stuck. But I don't think that's what happens... from what I understand that we collected, we see this same child process created at some point in time, and it doesn't go away.
    Yes, I realize that my JVM is very old, but I cannot find any bug fixes in the release notes that claim to fix something like this. And since this only happens once every day or two, I'm reluctant to just throw a new JVM at this--although I'm sure I will shortly.
    Has anyone else seen anything like this?

  • What is the difference between Process and Threads

    What is the difference between Process and Threads

    http://forum.java.sun.com/thread.jsp?forum=45&thread=525518&start=0&range=15#2519429

  • Process and thread execution time

    HI all
    I am doing a project to develop a high level simulation framework. In the project I need to calculate the number of cycles of a snippet of code in a thread. Like
    void func()
    event1():
    int x;
    x = x * x;
    for();
    while();
    exec(numberofcyles)
    event2();
    Here I want to calculate the number of cycles between event1 and event2 and pass these number of cycles to the exec(numberofcycles) which will later on be simulated. I investigated a number of tools like gprof, Dtrace, linux process statistics, rdstc, getrusage(). None of these seems to be very relevent.
    I tried linux process statistics i.e. /proc/<pid>/task/<tid>/stat. I can access the execution time of threads, but all the time I get 0 execution time. What I think that it reads the execution time of threads when it was started. Is there any way to get the updated execution time of thread?
    Any help will be highly appreciated.
    Irfan

    I suggest reposting in the Unix forum here:
    http://discussions.apple.com/forum.jspa?forumID=735

  • GUI ..Process and threads

    Hi..Folks
    Is it possible to read the output of a class by starting it as a separate thread in a GUI application?
    Currently we follow this approach. We start the class as a separate process (passing in what ever parameters needed) in the GUI(using RunTime.exec()). Read the output.
    But we need a reference to the class that is being started.
    Is it possible to get a reference to the class?
    Thanks in advance.

    Thanks for your replies.
    Oki this time i will be more specific..I want to start and read the output of a thread..So while the thread is executing I can hook in to the output stream and read the output simultaneously...Actually I came across this link [Convert a Java OutputStream to an InputStream|http://ostermiller.org/convert_java_outputstream_inputstream.html] ... which suggests some idea to it...But the code gives compilation error (the bold line) ..."Cannot refer to a non-final variable in inside an inner class defined in a different method"..I have attached the code..Any ideas?
    Readin.java creates the thread and sends in the PipedInputStream to tt.java's putDataOnOutputStream() which writes to the stream back...
    Readin.java
    byte[] b = null;
               PipedInputStream in = new PipedInputStream();
               PipedOutputStream out ;
              try {
                   out = new PipedOutputStream(in);
              } catch (IOException e) {
                   e.printStackTrace();
                new Thread(
                  new Runnable(){
                    public void run(){
                      try {
                        *     new tt().putDataOnOutputStream(new PipedOutputStream(in));*
                        } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                ).start();
               try {
                   in.read(b);
              } catch (IOException e) {
                   e.printStackTrace();
               String str = new String(b);
               System.out.println(str);
    ...          And the code for the other class is
    ... tt.java.....
    public  void putDataOnOutputStream(ByteArrayOutputStream out){
              String str="test";
              try {
                   out.write(str.getBytes());
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         }

  • Difference between viewoption.process and sourceoption.process.

    hi,
    In the Technical deplyment document, it tell me that calling a workflow by using sourceoption.process.But i know that we call a worflow by viewoption.process.
    this was code in the document
    <Form>
    <Field name='sourceOptions.Process'>
    <Expansion>
    <s>My workflow process name</s>
    </Expansion>
    </Field>
    </Form>
    can any one tell me what is difference in both ?
    Thank you

    The common usage of process and thread is as mjacobsca says. A process is a program that is currently excecuting. Each process has at least one thread running within it. Threads are sometimes called leightweight processes, so I would say process is the more general word. To complicate matters there are different thread depending on who owns them, the OS (native thread or the JVM (green thread).
    http://developer.java.sun.com/developer/qow/archive/97/index.html

  • High number of threads and high CPU usage on a single instance

    Without any apparent reason, in some moments of day the website reports an increment of the HTTP Queue Length from an average of 10/20 queued requests to 100/200 and more.
    In that period of time the Average Response Time increases but the number of the requests on the website don't. Even increasing the instances it doesn't help to resolve the problem (maybe it just reduced it).
    It seems that the problem is not related to the traffic on the site. This issue happens either when the traffic is high or low.
    The autoscaling works well, we don't have peak of traffic but always a slow increasing of requests and the CPU is always below the 50% (memory too). The issue is resolved by the swap of the site and sometimes it's resolve by itself after a while.
    What I discovered when the issue happens, is that there's an instance (just an instance only), that has an high number of threads and CPU usage on the W3WP.exe process and these values are above the mean than the other instances. Eg, instances are around
    50/60 threads and 10/20% of CPU, the instance with the problem has 200 threads and 50/60% of CPU. If I kill the W3WP process on that instance the issue is resolved. 
    I monitored the HTTP requests, I tried the website extension "Diagnostics as service" but I can't discover anything that can help me to understand the problem. Of course, there are many requests that go in timeout but it is a consequences of a
    unresponsive instance.
    On the web hosting plan there are only two sites: the production site and its staging which is used for update of the production only and it's always sleeping. Plus, no webjobs are running on this site.
    What can I do to gather useful information that can help me to understand the reason of this problem?
    Thank you!

    "Does the instance with the high counts receive more traffic than the other instances? Is it possible that the load balancer not
    working the way it should be?"
    How can I get that information? I can't see metrics for a specific instance
    "Does it always happen to the first instance?"
    I will check it better, but in the order given by the Processes panel it's the second instance which has the issue. The scaling is at 2 instances for the most part of the time (it's the minimum).
    Maybe one time it was the 3th instance but I'm not sure, I'll give it more attention.
    " How long do these moment last?"
    The time can be 10 to 30 minutes, but I fix it as soon as I see the problem. It's not the down-scaling to resolve it because in these situations the CPU as well is high so the scaling holds or increases the number of instances.
    "- How often do these moments occurs?"
    It occurs quite often, 2/4 times a week.

  • I run several processes and now they only get some 30% cpu in total, pre-Mavericks they got 100% each – what has happened?

    From Terminal I use gmake to run rather calculation intensive processes, usually in severel threads for several days. I need to process some 120000 files containing around 10 Tbyte data in total. The tools I use are implemented in C++ and have no GUI. Pre-Maverick this worked as expected: running four threads I got 4X100% cpu. After upgrading to Maverick I typically only get 30% in total. No other process is "stealing" cpu time, the computer is just sitting idle...
    Basically, my calculations now run at 1/16 the original pre-Maverick speed due to the lack of cpu time.
    In Activity Monitor I can tell that App Nap is off for these processes.
    I disapled timer coalescing, but it didn't help.
    Why are my processes somehow given such low priority?
    How can I solve this issue?

    Thanks for the reply. They might execute slightly faster after recompilation, but I don't really see why it would get me more cpu time? They execute as fast now as they did pre-Mavericks in terms of user+system time, but it does not help as they only get 1/16 as much cpu resources...
    Anyhow, one should try everything. I did recompile and it didn't help.

  • Prstat displays PROCESS/NLWP  with /0 , but high USR and SYS  cpu usage

    I'm running prstat on Sol 10u4 sparc and see from time to time one of more processes with high user and kernel cpu usage, The process name is just displayed as " /0". What is this ?
    see sample snapshot below:
    PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/NLWP
    18738 root 18 42 3.5 0.0 0.0 0.0 36 0.5 123 247 15K 0 sort/1
    18728 root 10 30 1.0 0.0 0.0 0.0 0.0 59 0 361 16K 0 /0
    18737 root 6.8 15 2.1 0.0 0.0 0.0 75 0.2 82 82 5K 0 awk/1
    18731 root 5.2 12 1.3 0.0 0.0 0.0 80 1.5 68 0 5K 0 /0
    18730 root 4.8 10 1.1 0.0 0.0 0.0 82 1.4 58 58 4K 0 /0
    18736 root 4.4 10 1.1 0.0 0.0 0.0 84 0.1 63 0 4K 0 grep/1
    18732 root 3.0 11 2.1 0.0 0.0 0.0 0.0 84 0 45 3K 0 head/1
    18735 root 4.3 9.2 1.1 0.0 0.0 0.0 85 0.1 57 57 3K 0 grep/1
    18729 root 4.3 8.7 1.2 0.0 0.0 0.0 84 1.3 103 51 3K 0 /0
    18734 root 3.7 8.9 1.0 0.0 0.0 0.0 86 0.5 52 52 3K 0 grep/1

    The slash number format is used to show the number of threads (light weight processes or LWP in Solaris parlance) in a given process (see the header says "PROCESS/NLWP"). I'd guess this is a race condition where prstat finds a process exists and has consumed some CPU, but when it goes to query the data on the process it's already exited so there's no process name and zero threads associated with it. For this to be true and to see this except more than every once in a blue-moon you'd have to have a system that was having processes forked at an amazing rate.
    I'd also say this is a bug, but one that you might have a hard time getting an traction on.

  • How could i get the kernel and user cpu usage for each process

    Hi all,
    In order to monitor the system CPU usage, I would like write a script to gather the kernel and user CPU usage for each process, like the prstat or top does. As always missing the shortlived kernel usage, prstat or top cann't get the precise CPU usage. I checked with the dtrace syscall, proc and fbt provider, but don't get which one is useful.
    Please provide your comments and suggestion.
    Thanks in adv

    mail2sleepy wrote:
    As I've studied the "dtrace" for a while, and seems Sun gives a pretty high score on this new feature.....I do want to know whether there's some probe can work for it, like writing a "dtrace" version prstat.You can write a prstat without dtrace. Because that's just polling at specific intervals and reading some process structures from /proc. You could have dtrace fire a probe every 5 seconds and read the same thing, but it wouldn't really be using any features of dtrace. Trhying to write it "in dtrace" doesn't make much sense.
    What you could do that would be harder via other methods is to fire a probe at process exit that displayed the process information including total CPU time. They could print exactly when processes exited. Doing that without dtrace would be very difficult.
    Darren

  • After closing Firefox to use IE8 or any other program, everything is very choppy and slow. I have to go into Taskbar, Processes, and close firefox.exe manually (which is using up all the memory/CPU). Then, and only then, does everything behave normally. W

    After closing Firefox to use IE8 or any other program (like InterVideo to watch a DVD), everything is very choppy and slow. I have to go into Taskbar, Processes, and close firefox.exe manually (which is using up all the memory/CPU and should have closed before). Then, and only then, does everything behave normally. What is going on and what am I doing wrong or missing??
    == This happened ==
    Every time Firefox opened
    == about a couple months ago and happens every time I close Firefox.

    <u>'''Kill Application'''</u>
    In Task Manager, does firefox.exe show in the <u>'''Processes'''</u> tab?
    See: '''[http://kb.mozillazine.org/Kill_application Kill Application]'''
    '''<u>Causes and solutions for Firefox hanging at exit:</u>'''
    '''[[Firefox hangs]]'''
    '''[http://kb.mozillazine.org/Firefox_hangs#Hang_at_exit Firefox hangs at exit (Mozillazine article)]'''
    '''[[Firefox is already running but is not responding]]'''
    <u>'''Safe Mode'''</u>
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox SafeMode is a diagnostic mode that disables extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes before starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your extensions and then try to find which is causing it by enabling one at a time until the problem reappears. You have to close and restart Firefox after each change via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.
    <u>'''''Other Issues''''': to correct security/stability issues</u>
    <u>'''Update Java'''</u>: your ver. 1.6.0.19; current ver. 1.6.0.20 (<u>important security update 04-15-2010</u>)
    ''(Windows users: Do the manual update; very easy.)''
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates Updating Java]'''
    Do the update with Firefox closed.

Maybe you are looking for

  • Premiere Elements 12

    New installation yesterday Premiere Elements 12, created a instant movie, today I cannot open the project. Error message "unknown error occured while opening project" what is the problem?

  • Javascript acts funny in IE & not Firefox

    I have a page uploaded on a server with 5 buttons that conrol a sub-menu selection thru javascript. When I preview the page in Firefox it acts like it should, no problems. When I view the page using Internet explorer only one of the sub-menus decide

  • I don't know how to change the email so I can get email on another email

    I need help with my I pod I need to get an email from apple but the email it wants to send it to I don't use any more I need help changeling the email how do I do that?

  • Give the read only access to user on Apps Schemas!

    Hi, How we can create the database user and give the access on APPS schemas(INV, PO etc). Please assist me. Thanks, Faziarain

  • Need help with Gradient Orientation being locked.

    I'm having a problem with my gradients not rotating with the object its applied to. Lets say I have a square that blends from red to blue left to right, as i rotate the box the gradient is locked in one position as the box changes angles. I need the