How to measure true CPU usage?

Hello,
I have a program that runs on a Windows XP 32 bits machine with JRE 6u16 (8 [email protected], 16gig ram). This program gets 100,000 messages per minute, does something with it and republishes the data.
We recently moved the same program to a Linux box, same spec, 64 bits however.
When running Visual VM via JMX on both in //, we can notice huge CPU utilization on the Linux box, vs. the Windows one.
I expected the Linux version to kick arse.
My question is, how to effectively measure raw performance on a multiple-CPU machine, Windows and Linux?
Also, how does the CPU graph works in jConsole or VisualVM? Average of all CPUs?
Thx v much

Take a look at this.
http://articles.techrepublic.com.com/5100-10878_11-6067049.html

Similar Messages

  • How to measure Java CPU & memory usage

    Hi,
    I'm not sure whether this is the right forum to post this message.
    I have a java application and basically it takes lots of CPU time and memory. What my concern right now is the CPU usage. Basically I reduced the number of CPUs from 8 to 4 (Solaris v1280 box) and the CPU usage got increased from 30% to 90% :(
    My requirement: Is there anyway that I can measure the CPU usage using Java code itself, so that I can insert those "set of APIs" (for measuring CPU usage), between APIs to collect the CPU usage data?
    Thanks,
    Siva

    Take a look at this.
    http://articles.techrepublic.com.com/5100-10878_11-6067049.html

  • Measure Java CPU usage

    Hi,
    I'm not sure whether this is the right forum to post this message.
    I have a java application and basically it takes lots of CPU time and memory. What my concern right now is the CPU usage. Basically I reduced the number of CPUs from 8 to 4 (Solaris v1280 box) and the CPU usage got increased from 30% to 90% :(
    My requirement: Is there anyway that I can measure the CPU usage using Java code itself, so that I can insert those "set of APIs" (for measuring CPU usage), between APIs to collect the CPU usage data?
    Thanks,
    Siva

    The comparison would be unfair (by your definition of unfair) in Java, too, since the JVMs for both platforms are different.
    If you are dealing with time, though, 500 milliseconds is 500 milliseconds, no matter what language you write it on or what platform you run it on. If you use VC++ for the Windows stuff, make sure you disable Microsoft extensions so you have some ANSI standard code that will compile with gcc.
    Since you are trying to compare operating systems, make sure both machines are using the same processors (and motherboards with the same PCI bus architecture), too. And have the same amount of memory, which is the same speed and architecture on both. Their hard drives should be roughly the same speed, too. The PCI bus usage could vary with network cards, so having the same network cards will be a plus. What it seems to come down to is that you are going to end up measuring the performance of the socket library implementations on both machines.
    As far as JNI goes, all it is is a way to write native code and use it in your Java application. I don't know much about it, search around for some examples. There's a tutorial, somewhere, too. Some dude on here, tpritchet, seems to know a lot about it.
    Jason

  • [Debugging] - how to avoi intensive CPU usage with debug command

    Hi all !
    I hope you're well !
    I'm just wondering if there is a mean to avoid the increase of CPU usage when using the debug command. More precisely I would like to know if it exists something to avoid the CPU to saturate and to allow vital process to be prioritary for using the CPU, just like a QoS mecanism but to classify the process in order of importance.
    Thanks a lot in advance !

    some time ago this document was posted on CSC which give an excellent overview on how to savely enable debug commands:
    https://supportforums.cisco.com/docs/DOC-16310

  • How to lower the CPU usage level?

    My CPU usage level has always been over 90% even after i restart my mac book pro, what should i do?

    u09mi7
    You can launch activity monitor to see what processes are using what amount of CPU. Also there is an application called AppTamer it is a sharware program and has gotten good reviews. It helps to reduce CPU usage on programs that are kind of in the background, one's you're not using at the moment. I would also recommend iStats Menu which monitors are the vital systems, memory, cpu, temps, disk activity etc...if you don't want to pay for the license the dashboard widget iStats Pro is free of charge and does the same thing. Do you have a lot of apps starting as login items? Hope this helps. Follow up and let us know how things are working.
    Regards,
    Joseph

  • How to remove the cpu usage limit?

    I have to run a C program on terminal as fast as possible. However, there seems to be a cpu usage limit for the terminal, the program supose to run around 15 seconds on a linux machine with similar configuration where cpu usage is at 85-95%. But, it runs one minute on my macbook pro with cpu usage less than 15%. Finally, my question is, how do I utilize all of the 85% idle cpu for this program or at least most of the idle cpu?

    Per se, MacOS X does not impose any CPU usage limits other than those from the processor scheduling priorities. Standard Unix scheduling priorities go from -20 to +20, with the default being 0. If you have administrator privileges, you increase your process' priority (a more negative value) with the nice or renice commands. See their man pages. On a four-core 15" or 17" MBP, even setting max -20 priority should not impact the rest of the system too much.
    You may also want to go over and discuss these things in the Unix forums:
    https://discussions.apple.com/community/mac_os/mac_os_x_technologies

  • How to get max CPU usage

    I'm using Win 7 64bit and CS6 64bit.
    However, when I do some heavy editing, like anything that takes a few minutes of CPU processing, I tend to look at the task manager only to find that 4 cores are utilizing 50% at max thus taking longer to compute the results.
    Is there a way to maximize CPU usage by Photoshop? I would like it to use 100% when performing tasks to speed up process time. Is there a windows plug in?
    Thanks,
    Gil.

    It depends on how each of the portions of Photoshop you're using was implemented.  There's little you can do to influence it.  About the only thing I can think of is that you can adjust the Tile Size and Cache Levels values in the Edit - Preferences - Performance dialog.  On some systems with some kinds of operations smaller tiles can make things work faster and with others large tiles are better.  But be forewarned:  I've never seen changing those values make a very big difference. 
    One other thing you can do is adjust the max RAM you allow Photoshop to use.  Your OS probably itself doesn't need more than 1 to 2 GB, and if you don't specifically have another application you want to run that uses a lot of RAM you'll want to change the Photoshop RAM usage so as to leave just a few GB for the OS.  On a system with a huge amount of RAM that might mean setting it to 90% or more.  If Photoshop can keep things in RAM, your CPU will be busier because it won't be waiting on swapping data to/from disk.
    Make sure you restart Photoshop before testing any changes.
    There are filters that you SHOULD see use 100% of all your cores - example, try a Filter - Blur - Radial Blur on a large image.  There are other things that simply don't, because either there isn't a good way to multi-thread the activity (e.g., data compression during save) or the Photoshop implementation is just limited because it's not been updated since the advent of multi-core systems (e.g., some of the old artistic filters).
    When I was doing performance testing, I created an action that does a lot of the kinds of things I normally do to images, so that I could run it repeatedly and time the results, looking for differences as a result of choosing the different settings.  There are Photoshop benchmarks on the web that do much the same thing, and while it might not be a good match for what you do (none of them were for me), they ARE interesting in that they allow you to compare your performance to other systems out there, to make sure everything's working right.
    -Noel

  • How to configure for CPU usage

    I installed two virtual servers in one host that installed VM Server, is there any way to
    assign only 30% at mot of cpu usage to the first virtual server while the left 70% cpu usage
    to the second virtual server

    For first virtual machine add vcpu=3 and for second virtual machine add vcpu=7 in vm.cfg. This should devide your available CPU's in 30/70 %.
    Personally I haven't tried this for cpu % allocation, but you can give a shot .
    Thanks.

  • How can i reduce CPU usage while playing video?

    Hi,
    I have recently finished and then published a  project to my desktop which is a video jukebox application. The  application plays music videos in a large popup window upon a button  click. The problem i have is that when the video is not playing the CPU  usage on my windows machine runs at about 15% on average, however once  the video is playing in the popup the CPU usage jumps to almost 90-100%.
    I  have seen some of the developements introduced in Flash 10.2 in regard  to Stage Video and was wondering if this could maybe fix my problem. At  present my application is running on AIR 1.5 with Flash Player 9. If I  simply install the latest versions of AIR and Flash Player and try  running my published project again will this be enough to improve the  video performance? Or do I need to change the settings of my project  within Flex Builder so that it uses the latest version Flash?
    Any advise would be great.
    Thanks
    Adam

    StageVideo is still not available for AIR and until then it appears nothing can be done about this problem.

  • Macbook getting how with very little cpu usage

    So my macbook pro with retina display is getting oddly hot.
    I run a few applications, about 5 or so, and the CPU reached about 95C, then was pulled back by the fans to 80C. I then played 1 game, (and left other aps open), and the CPU reached 101c. I've then closed everything but two aps, an IRC client, and safari with 6 tabs.
    Current CPU usage:
    16 - 19%
    CPU temps:
    Average is 80C
    Fan speed:
    3710 rpm
    Program I'm using to record temps:
    Temperature Guage
    I've also let the vents on the side of the computer containing the cpu/gfx chip be suspended in air so they aren't onstructed by anything.
    Is there something wrong with my MBP? Apple's tests said everything was alright but it's getting VERY hot compared to many stories I've seen across the net.

    ThePilotGuy wrote:
    Also, when I restart the comp, should the temps stay the same, even after idling for a minute? They do for me.
    Also, restarted my comp, same dock issue persists.
    EDIT: Also, when I restart my computer, the background always changes to this grey backgroundless color and I have to re-set it.
    And, when I log in, the screen quickly flashes white then takes maybe 5 to 9 secs to login. It hasn't done this until recently.
    EDITEDIT: When the background is colorless, the bar at the top of the screen is just black, I cna't read any of the text.
    The white flash is normal. That's the end of launchd process and the start of the loginwindow process.
    The delay in the appearance of the loginscreen indicates that either
    1. you're running something in
     > System Preferences.. Users & Groups | Login Items
    that is causing the problem every time you bootup and login. If either Skype or Limechat are in that list, get them out. Ideally, get everything out of that list.
    or
    2. if there's nothing in your Login Items, you may have a corrupt plist file. Force the system to make a new one by running this command in Terminal (beware that it will reset your Dock to default prefs, so if you've added any other icons to the Dock you'll have to do that again afterwards):
    rm ~/Library/Preferences/com.apple.dock.plist
    press 'return' on the keyboard and restart the mac.

  • How to find the cpu usage per query for a time period

    Hi All,
    Is there a way to find the cpu used per query for a given time period?
    DB:10.2.0.5
    OS:AIX
    Thanks

    user13364377 wrote:
    if there are multiple queries starting at the same time, then what to do?Handle:      user13364377
    Status Level:      Newbie (10)
    Registered:      Jul 5, 2010
    Total Posts:      264
    Total Questions:      113 (84 unresolved)
    why so many unanswered questions?
    clarify your question
    same SQL multiple times from different sessions?
    or
    different SQLs from different sessions?

  • How to measure CPU utilization from Oracle AWR

    Hi All,
    How to measure the cpu usage % from the AWR reports.
    Oracle : 10.2.0.3
    OS : AIX 5300-12-02
    I see the top 5 waited events listing CPU time in it.
    Top 5 Timed Events Avg %Total
    ~~~~~~~~~~~~~~~~~~ wait Call
    Event Waits Time (s) (ms) Time Wait Class
    CPU time 98,655 40.0
    Is it mean that the CPU utilization is full to its 100%. Is there any other way to measure how much an oracle instance is utilizing the CPU ?
    Please advice.
    TIA,
    Nv

    Hi,
    Check this script, if possible run in toad.
    col LastCallET format 99,999
    col cpumins format 99,999
    col status format a1 trunc
    col module format a20
    col username format a15
    col logontime format a12
    col machine format a15 trunc
    col sid format 9999
    select * from (
    select 'P',s.sid, s.status, t.value/100/60 cpumins ,
         floor(last_call_et/60) "LastCallET",
         to_char(s.logon_time,'mm/dd hh24:mi') logontime,
         s.username,s.process, p.spid, s.module , s.machine, s.sql_hash_value
    from v$sesstat t, v$session s, v$process p
    where t.statistic# = 12
    and s.sid = t.sid
    and s.paddr = p.addr
    and s.type = 'USER'
    and s.sql_hash_value != 1425819161
    union
    select 'N',s.sid, s.status, t.value*-1/100/60 cpumins ,
    floor(last_call_et/60) "LastCallET",
    to_char(s.logon_time,'mm/dd hh24:mi') logontime,
    s.username,s.process, p.spid, s.module , s.machine, s.sql_hash_value
    from v$sesstat t, v$session s, v$process p
    where t.statistic# = 12
    and s.sid = t.sid
    and s.paddr = p.addr
    and s.type = 'USER'
    and s.sql_hash_value != 1425819161
    and t.value < 0
    order by 4 desc)
    where rownum < 11
    Regards,
    Satya.

  • How to control timing without 100% CPU usage

    I wanted fine control over timing (in windows XP), but ran into two problems.
    Problem 1: If you use the Swing timer, or Thread.sleep, the resolution is limited to 10 or 11 milliseconds. There is a Thread.sleep(millis, nanos) function, but I tested it and it still has 11ms resolution in WinXP.
    Problem 2: If you use jbanes's GAGE timer, CPU utilization will always be 100%.
    Solution: Use a hybrid technique. I would love to have nanosecond resolution AND low CPU utilization at any speed (and if you have any suggestions, please post them) but for now:
    class /*name*/ extends Thread{
    public void run(){
              setDelay(delaySettings[speed]); //Set "delay" to the desired delay in nanoseconds
              long nanos;
              while(true){
                   if(running){ //"running" is a boolean that can pause or unpause the game
                        nanos=System.nanoTime()+delay;
                        tick(); //Do the game logic and graphics for one frame
                        if(delay>11000000){ //If the system timer can handle it
                             try{sleep(delay/1000000);} //delay/1000000 gives millis
                             catch(Exception e){System.out.println("Caught sleep exception: "+e);}
                        }else{ //use a nanotimer (cpu-expensive)
                             while(System.nanoTime()<nanos){}
                   }else{ //it is paused, so wait a bit
                        try{sleep(50);}
                        catch(Exception e){System.out.println("Caught sleep exception: "+e);}
    //The rest of your code
    }If your desired delay is greater than the system timer resolution (here, I have it set at 11,000,000 nanoseconds, or 11ms) then you can use the Thread.sleep(milliseconds) call, which will have approximately 0% CPU utilization until the thread wakes up. Theoretically, you could use this time for another thread, but at the very minimum, your computer should use less power / generate less heat. If your desired resolution is smaller than 11,000,000 nanoseconds, it goes into a loop that checks nanoTime()... which gives you 100% CPU usage, but is very accurate. This works pretty well if you want to control the framerate dynamically (I use the "-"/"=" buttons to adjust speed) and it handles "pause" events, though I'm sure there are better ways to do that.
    Note: The timing granularity above 11ms for this technique is probably 11ms, though the code could be modified to provide nanosecond granularity at any speed.
    Note 2: I found this to run 3% faster than when I used the GAGE timer.
    -Cherry

    Pause the game when u alt-tab away ^_^
    Thats what most native fullscreen games do (the
    non-networked kind atleast)Good idea, but the crux of the issue is really the underlying scheduler which allows
    the thread to race.
    How to "Eliminate" 100% CPU usage.
    Tony's Law of the exec constant. <<<<"Any thread or process running on a non-preemptive operating system MUST NOT use blocking
    IO, and MUST preempt itself at leat 20MS per iteration."
    The reason it is called a constant is because it is the minimum time needed to ensure
    the underlying operating system gets enough CPU cycles to function correctly.
    Every milliseconds below this increases exponentially the chance of locking up or
    crashing despite the speed of your system.
    Most people who program do not realize the the implications of running under defective schedulers
    such as the one provided with MS windows where, for example, you can block on a socket, and
    hang your whole system.
    >>> Do NOT use Thread.sleep() <<< but instead use Object.wait();
    Do not use blockng IO. If you have to use java.io, use available() to make such you ONLY
    read the exact amount of bytes you need without blocking and make sure to prempt
    yourself at least 20MS per iteration.
    ie:
    InputStream inputStream;
    while(working)
    Object waitObject = new Object();
    int readCount = 0;
    int availableBytes = 0;
    int  totalBytes = 10;
       while(readCount < totalBytes)
          if((availableBytes = inputStream.available())!=0)
              read() (the # of Bytes available)
          else
              synchronized(waitObject)
                   waitObject.wait(200);        // 5X per second poll
                    waitObject.notifyAll();
    Using wait() removes the current thread from being scheduled; Thread.sleep()
    leaves the Thread on the schedule list. wait() releases all monitors allow other
    threads to have them; THread.sleep() does not.
    The 100% CPU issue is especially bad under NT BTW.
    If you do this not only will your CPU usage go to negligible, but you
    will never again lock your system because of it.
    Good Luck!
    (T)

  • How to find out CPU and memory usage for an instance?

    Hi DBA Gurus,
    How to find out CPU usage and memory usage for an instance?
    Any information is appreciated!
    Thank you!
    Robert

    you can calculate cpu usage by adding fallowing three factors which you can get from v$sysstat
    1. Parse CPU time : This represents the percentage of CPU time spent parsing SQL statements. Parse time CPU can be a strong indication that an application has not been well tuned. High parse time CPU usually indicates that the application may be spending too much time opening and closing cursors or is not using bind variables.
    2. Recursive CPU time : Sometimes, to execute a SQL statement issued by a user, the Oracle Server must issue additional statements. Such statements are called recursive calls or recursive SQL statements. For example, if you insert a row into a table that does not have enough space to hold that row, the Oracle Server makes recursive calls to allocate the space dynamically if dictionary managed tablespaces are being used.
    Recursive calls are also generated due to the inavailability of dictionary info in the dictionary cache, firing of database triggers, execution of DDL, execution of SQL within PL/SQL blocks, functions or stored procedures and enforcement of referential integrity constraints
    3. Other CPU time : This represents the percentage of time spent looking for buffers, fetching rows or index keys, etc. Generally, \"Other\" CPU should represent the highest percentage of CPU time out of the total CPU time used.
    total memory used you can calculate adding
    total_agrigate_area+sga
    memory usage on os level you can know by fallowing commands
    vmstat 5 20 depending upon os

  • High CPU Usage On client application when upgrade remote SQL database

    Hi,
    Is anyone here encountered very high CPU usage after upgraded the database from SQL 2005 to SQL 2012? Following describes my issue.
    I have my client application running on Windows 7 that access to central database (SQL 2005) on Windows server 2003 using ODBC connection, this client application basically query data and perform data insert and update. There are a number of this similar
    clients connected to the database.
    Due to slowness of the database server, company decided to upgrade the database server to SQL 2012 and also new hardware runing Windows Server 2012. There is no change on the client application and client hardware and the client application still using the
    same ODBC connection to query, insert or update the new database server.
    The problem I am now experiencing now is that my client PC where my client application running the CPU usage is very high almost hitting 100% when accessing to the central database. I am also noticed this program lsass.exe that utilized almost 40-50% of
    the CPU time when client application accessing the central database.
    Is anyone here know, why client PC CPU usage 100% when access to upgraded SQL 2012 database? What is lsass.exe program doing, it only appear when accessing to database server. How to reduce the CPU usage on client?
    Thanks.
    Chee Wee.

    Hello,
    After upgrading, please rebuild indexes and update statistics on the databases.
    http://www.mssqltips.com/sqlservertip/1367/sql-server-script-to-rebuild-all-indexes-for-all-tables-and-all-databases/
    http://www.mssqltips.com/sqlservertip/1606/execute-update-statistics-for-all-sql-server-databases/
    Configure maxdop on the instance.
    http://blogs.msdn.com/b/sqlsakthi/archive/2012/05/24/wow-we-have-maxdop-calculator-for-sql-server-it-makes-my-job-easier.aspx
    If the above does not solve the issue, let us know.
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

Maybe you are looking for

  • How to aware a DN that has been copied to AR draft

    Dear all, When they copy a DN to an A/R, the DN is still open and the system will allow us to copy it to another A/R draft. I know if we add one A/R, the others include that DN the system will not allow us to add it. The problem is, sometimes they ha

  • FCP7.0.3 crashing with Motion template on Snow Leopard

    Have upgraded from a Leopard from the 2009 MacPro install of Final Cut Studio3 to Snow Leopard on the current Westmere hardware with the same Final Cut Studio 3 application. The Motion Templates in the FCP application are causing application crashes.

  • Forms60_path problem

    Respected all.. I am running about 8 applications developed in developer 6i and back end is oracle 9i. each applications forms are placed in separate folder. when i give path in register editor more than about 5 to 6 applications then oracle froms ru

  • SQL query returning data inconsitantly

    I am running Oracle 8i and have create a stored procedure that has a cursor in it. The select statement for the cursor returns 15 records that I loop through and insert into another table. At the beginning of the loop, just before the insert statemen

  • Changing colors of individual records in multi-record block

    Can any point me to where I should place the code to programmatically change the color of a record in a multi-record block based on a particular column value? For instance, if block.col1='OPEN', I'd like the entire row to display as BLUE. If block.co