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

Similar Messages

  • CPU Memory usage

    CPU memory usage is keep increasing whenever, I have opened a package from SQL developer. I am using the latest version (4.0.0.13.80) of sql developer. How to resolve this.?

    Hi,
    If you use Oracle 10g v.2 you can take a look and recomendations about memory tuning using AWR (Analytic Workload Repository). Of course , theoretically , you can take a look on Oracle doc titled 'Oracle Performance Tuning '.
    Sorry , i didn't know that your database is 9i. However , if you open Enterprise Manager Console on Memory Section you can find the memory statistics of your database and some pieces of advice , as well.....
    Simon
    Message was edited by:
    sgalaxy

  • How do I clear off memory usage from "calendar" it kept on building up

    The calendar usage in my ipad kept on building up, although I don't store anything on it, how do I clear the memory usage?

    When you connect your phone to the Mac, iPhoto should fire up and offer to import your photos. So do so, selectively if needed. Then make sure they are backed up to external media in case your Mac dies. Then delete them from the camera roll in the iPhone.
    Read how Sync works. The User Guide is available at http://support.apple.com/manuals/ or downloadable from iTunes as an iBook.

  • CPU/memory usage of AIR application under Mac 10.4.10

    As my AIR application uses a lot of CPU/memory under Mac
    (seems better in Windows), I decide to do some basic testing. I
    create several applications with different level of complexities.
    Below is a table of CPU/memory usage when the application is simply
    sitting there. A brief description of the application can be found
    in the end of each line.
    Here are some results:
    [1] Even for an empty application, CPU usage is not zero
    (most non-AIR application has 0 CPU usage when doing nothing). Also
    the memory usage is huge, comparable to Finder on my computer.
    [2] Empty application has 7 threads running.
    [3] Indetermined progress bar costs a lot of CPU; and I guess
    any other animation costs a lot of CPU too. But if they are
    invisible they are fine.
    [4] running timer costs CPU.
    PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE
    VSIZE application
    10093 adl 1.8% 0:01.85 7 100 292 15.0M 13.8M+ 22.8M 444M
    empty
    10094 adl 1.9% 0:01.55 7 100 299 15.2M 14.0M+ 23.1M 444M
    label
    10097 adl 1.9% 0:01.48 7 100 302 15.3M 13.4M 23.7M 445M
    progress bar
    10095 adl 5.7% 0:02.40 7 100 302 15.4M- 13.2M 23.5M 445M
    progress bar (indetermined)
    10125 adl 15.9% 0:03.66 7 100 304 15.7M- 13.4M 23.9M 445M 5
    progress bar (indetermined)
    10126 adl 29.7% 0:10.39 7 100 325 16.7M+ 13.4M+ 24.9M+ 445M
    10 progress bar (indetermined)
    10128 adl 1.9% 0:01.34 7 100 324 16.1M 13.7M 24.3M 445M 10
    progress bar (indetermined), visible=false
    10136 adl 1.8% 0:00.76 7 100 323 16.5M+ 13.9M+ 24.7M- 450M
    Empty datagrid
    10147 adl 1.9% 0:01.60 7 101 328 16.1M 13.8M+ 24.5M- 447M
    TabNavigator with two empty VBox children
    10138 adl 1.8% 0:01.59 7 100 372 19.4M 13.9M 27.7M 453M
    datagrid with 10000 simple rows
    10131 adl 3.1% 0:02.38 7 110 348 25.7M 19.3M 34.8M 458M 10
    Empty native windows
    10143 adl 1.9% 0:00.99 7 100 296 15.1M 13.9M+ 23.2M- 444M
    Timer, delay = 100ms, calling an empty function
    10145 adl 4.1% 0:02.35 7 100 298 15.0M 14.0M+ 23.2M- 444M
    Timer, delay = 100ms, calling function update label position
    As to my own application, it's much bigger than these simple
    ones. The CPU usually stablizes to 20% and VSIZE is about 1G. There
    is no timer running. When I leave the application open for a few
    hours, the application will eventually freeze and I have to kill
    it.
    I am wondering if there are any articles or documents
    explaining AIR's CPU/memory usage. And also if AIR is planning to
    improve the performance in the next release.

    James, thank you for the very fast answer! I did various tests on the weekend on my computer and computer of my friend.
    And I can say, that Debug flag doesn't affect memory consumption.   They still eat memory. My steps to reproduce are as follows:
    (Windows 7 32 bit)
    Photoshop CS5:
    1) set HKEY_CURRENT_USER\Software\Adobe\CSXS2Preferences\PlayerDebugMode to 0
    2*) check HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\CSXS2Preferences (just in case)
    3) Compile HelloPhotoshop example to ZXP and install via  Extension manager
    4) restart computer
    5) Run Photoshop CS5 - Memory consumption: 100 096 KB
    6) Open HelloPhotoshop and close it 10 times
    7) Memory consumption: 155 840 - 5,574 MB per one close/open
    Maybe a garbage collector is expected to run and free this memory, but it never happened in my case. The memory pool was increasing to 1 GB when I was working with one of my panels - with no documents open in Photoshop
    In InDesign I tried the same thing with HelloInDesign ( I had to close the panel completely and then open with Window | Extensions | HelloInDesign)
    Memory consumption on start: 118 516
    Memory consumption after 10 open/close cycles: 197 516
    It's 7,9 MB per one close/open
    It's the simpliest panel test. When I'm using AIR libraries the memory usage is increasing a lot faster.

  • CPU/Memory Usage increases when loading SWF files in AIR.

    Hi,
    We face the below mentioned problem. Would be great if someone could help us.
    Due to problems with uploading the attachment here, please send a email to the following email-id ([email protected]) and I shall send the attachment in response.
    CPU/Memory usage increases drastically while moving the SWC components and loading the SWF Files.
    "Problem Description" - On executing the sample application, a window with multiple objects is shown. The loaded SWC components in flex consume too much Memory and CPU cycles. This is visible in TaskManager. On dragging one of the object, CPU  / memory usage increases drastically.
    "Steps to Reproduce" -
    Draggable window is placed at the bottom in the sample application with Text indication.
    Drag the indicated window.
    "Actual Result" - System's CPU usage increasing drastically  around 50% to 60 %.
    "Expected Result" - Drastical increase in memory\CPU should not occur.
    "Any Workarounds" - No"
    Thanks in advance.

    You can control your external swf from your main.swf in the following method:
    loadswf(clips[0]);
    function loadswf(tmp:String):void{
        passedString=tmp;
        ldr= new Loader();
        ldr.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, progressListener);
        ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoaded);
        ldr.load(new URLRequest(animPath+tmp));
        function progressListener (e:ProgressEvent):void{
            ploader.visible=true;
        function swfLoaded(e:Event):void {
            mcExt = e.target.content as MovieClip;
            ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, swfLoaded);
            mcExt.addEventListener(Event.ENTER_FRAME,onEnterfn);
            ploader.visible=false;
            addChild(mcExt);
    function onEnterfn(e:Event):void{
        var num:int=mcExt.currentFrame;
        switch(passedString){
            case clips[0]:
                if (num==1) mcExt.play();
                if (num==9) {
                   mcExt.skipmc.addEventListener(MouseEvent.CLICK,skipfn);
                    function skipfn(e:MouseEvent):void{
                        mcExt.stop();
                       mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
                        gotoAndStop("help");
                if (num==mcExt.totalFrames){
                   mcExt.removeEventListener(Event.ENTER_FRAME,onEnterfn);
                    gotoAndStop("help");
                break;

  • 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

  • CPU & Memory usage is more..

    Dear Friends,
    i have developed my ticker with alert option using Flash and
    AIR. it is running fine! As a ticker it has to run contineusly,
    when it runs contineouly mymemory usage and cpu usage is keep on
    getting increased and the memory usage size also more. pls give me
    the suggestion how to reduce it. becoz, this ticker has to run
    contineously, in one stage it may hang the system it seems...
    pls be informed that, previously i used timer, to reduce
    memory problem and cpu usage, removed timer and i inserted a
    moviclip running for 1 sec, end of movieclip i triggered the
    event... then also the same memory usage iam getting..
    pls give me some solution for this....
    Regards,
    Syed Abdul Rahim

    I recently published a blog post which might help you.
    http://spreadingfunkyness.com/garbage-collection-with-flex-and-adobe-air/
    Also check out the references at the bottom.
    Hope this helps.

  • How to analyse the main memory usage in SAP ERP systems?

    Dear expert,
    I'm doing a research work about analysing the main memory usage in SAP ERP systems.
    I would like to find out what is load in buffers and when. That means, which process have the control of these memories and which are always performing something, tables loaded, and so on. Becuase I tried to isolate the space needed by a simple webservice call (create one material) in my test system, but even after a $SYN there are something stored in the buffers. I use a BAPI to avoid the execution of the SAPGUI and its repercussion in the system (I know the BAPI called uses resources too, but when I run this BAPI to get the statistics, it's like ST02, I get different values). Could someone help me or recommend something specific to read? Thanks a lot in advance.

    Dear expert,
    Thanks a lot for your answer. The point is now that I want to isolate the memory used by a webservice that I call, I mean, I would like to know how many memory is this webservice using in each buffer. And could you tell me where could I read something about the order that things happen in SAP System when a webservice is called (always memory related), that's which steps are done to store data in buffers and so on. Thanks in advance.

  • 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

  • How do I get CPU / memory utilization information via the API?

    I can't seem to find anything in the iOS API that would give me information about CPU utilization (user, kernel, idle) and memory (free, pinned, idle, in use), but I see apps like System Activity Monitor in the app store that provide such information. Can anyone point me to the relevant part of the SDK?

    This is a quection for the Developer forum.

  • How do I fix the memory usage back to what it is supposed to be?

    Okay, starting yesterday, the usage data says that I have used up 11 GB, even though several days before I have 18 GB left (after downloading a movie, making it 20 GB before) and now it has 16 GB. I counted up all of the MB and GB on the usage and it only adds up to 2.7 GB of used data. How do I fix it to go back to its original? My mother is a customer technician helper at AT&T and she said that she would help me with this, but obviously, we forgot.

    Connect the iPod to your computer and look at the storage used by the various categories as shown in the colored bargarph in iTunes.
    Come back with the results.
    An "other" larger than about 1 1/2 GB indicates corrupted files.
    What is the Other on my iPhone and How to Remove It
    What is "Other" and What Can I Do About It?
    Next, usually restoring from backup eliminated the corrupted files. However, sometimes restoring to factory settings/new iPod is required.
    To restore from backup see:
    iOS: How to back up
    To restore to factory settings/new iPod see:
    iTunes: Restoring iOS software

  • How to minimize Firefox memory usage

    I've been using mozilla software for a very long time, but lately memory usage in firefox has been getting far too out of hand. I used to be able to have hundreds of pages open without using too much memory, but for some time now I have only been able to have a fraction of the number of pages open before hitting the same levels of memory use. A new firefox session I opened today hit 600 megabytes of memory after loading 7 pages. Earlier today, firefox was collectively using over 20 *gigabytes* of memory. This is all for firefox itself, which is set up without any extra plugins beyond the basic ones for flash, java, and audio/video. Sometimes I've gone to using elinks for some of my "main" browsing just to avoid the extra memory bloat, but I would much rather use a more complete browser when I don't need to browse through a ssh tunnel.
    When I purchased 16 gigabytes of memory for my computer, I did not expect all of it plus some to be used just by my internet browser, so I need to know how to cut firefox's memory usage as much as possible. I care next to nothing about caching, especially since I already have a caching proxy anyway (squid 3). I just need firefox to not end up leading me to a newegg page for an additional 16 gigabytes of memory. What can I do to alleviate this issue?

    Hi,
    These two links might help
    *https://support.mozilla.org/en-US/kb/firefox-uses-too-much-memory-ram
    *https://support.mozilla.org/en-US/kb/firefox-uses-too-many-cpu-resources-how-fix
    Firefox has hardware acceleration set to "on" by default, but it's still young, which means some video cards or drivers might have problems with it. You can try to disable hardware acceleration to see if that alleviates your problems.
    You might need to restart Firefox in order for this to take effect, so save all work first (e.g., mail you are composing, online documents you're editing, etc.).
    Then perform these steps for Firefox version 29.0 and above:
    *Click the menu button [[Image:New Fx Menu]] and select {menu Options} for Windows or {menu Preferences} on Mac or Linux. For Firefox 28.0 and previous versions, click the orange Firefox button at the top left, then select the "Options" button, or, if there is no Firefox button at the top, go to Tools > Options.
    *In the Firefox options window, click the ''Advanced'' tab, then select "General".
    *In the settings list, you should find the ''Use hardware acceleration when available'' checkbox. Uncheck this checkbox.
    *Now, restart Firefox and see if the problems persist.
    Additionally, please check for updates for your graphics driver by following the steps mentioned in the following Knowledge base articles:
    * [[Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems]]
    * [[Upgrade your graphics drivers to use hardware acceleration and WebGL]]

  • 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.

  • Best practice for CPU and memory usage?

    I find my AIR application takes a lot of memory -- usually
    >170M. And what is strange is that the memory usage is
    increasing (about 4K/s) even when the application is simply sitting
    there and do nothing. The CPU usage is supposed to be 0% when the
    application is doing nothing, but it's not (usually ~5%). So I
    wonder if there is any article about best practice on CPU/Memory
    usage.

    Those numbers indicate that your application is in fact doing
    something. Perhaps you have a timer still running, or work being
    done on an enterFrame event?

  • How to reduce memory usage?

    OK - I've read through a ton of posts that discuss the "Out of memory" problem in Encore, but what can I do to reduce memory usage?
    I'm trying to produce a very simple Blu-Ray (h.264) project in Encore CS3 on Windows Vista. There are 8 or 9 timelines, a main menu, and 6 sub-menus. Each sub-menu has six static buttons. There are no transitons or motion menus. When I load the project, Task Manager says Encore is using about 1.3 GB RAM. I constantly get "out of memory" errors.
    I've loaded the same project on Vista 32-bit w/ 4GB RAM and Vista 64-bit w/ 8 GB RAM. Same behavior on both.
    Two questions:
    1. Why does Encore need 1.3 GB RAM for such a simple project?
    2. How do I reduce the memory usage?
    TIA for help on the PITA,
    rgames

    Please check with below link, if this can help.
    http://forums.creativecow.net/thread/145/863785#863796

Maybe you are looking for

  • Problem with Webi

    I have been searching the forums, and while I have seen this issue posted before, I have yet to see a definitive resolution. I am hoping someone can help with this. I have a user that is attempting to export a report from Webi to Excel, and receiving

  • Decrypt problem

    Hello! I have problem decripting string if the string is long. I use <cfset session.algo = "DES"> <cfset session.key = GenerateSecretKey(session.algo)> <cfset session.enco = "HEX"> I have tried and other but nothing works for me. also i do the encryp

  • Is an OCR app included with the purchase of a Canon MF216n multi-function printer?

    Just purchased this multi-function printer and the documentation seems to imply that I need to acquire an external OCR app.  Please confirm and / or clarify.  Or do I need to download an app from the web like Free OCR to Word? By the way, so far the

  • HOW TO USE THE FRONT CAMERA

    hi all any possible way to use the front camera in n900, coz i cant see any option for the front cam and for basic camera any option for night vision when shooting ? Thx Solved! Go to Solution.

  • How do I prevent losing work when down saving from CC to CS6?

    I'm working on a design and I have CC. I need to share it with a coworker, but they only have CS6. Will we have any problems working on the design on both platforms?