Questions tagged [cpu-usage]

CPU usage indicate how much of a workload is being handled by the CPU.

CPU-usage or CPU time is the amount of time for which a central processing unit (CPU) was used for processing instructions of a computer program.

CPU time accounting :http://public.dhe.ibm.com/software/dw/linux390/perf/CPU_time_accounting.pdf

2881 questions
250
votes
11 answers

How to get the CPU Usage in C#?

I want to get the overall total CPU usage for an application in C#. I've found many ways to dig into the properties of processes, but I only want the CPU usage of the processes, and the total CPU like you get in the TaskManager. How do I do that?
Grace
224
votes
22 answers

Retrieve CPU usage and memory usage of a single process on Linux?

I want to get the CPU and memory usage of a single process on Linux - I know the PID. Hopefully, I can get it every second and write it to a CSV using the 'watch' command. What command can I use to get this info from the Linux command-line?
Supertux
  • 8,088
  • 10
  • 42
  • 47
211
votes
3 answers

MySQL high CPU usage

Recently my server CPU has been going very high. CPU load averages 13.91 (1 min) 11.72 (5 mins) 8.01 (15 mins) and my site has only had a slight increase in traffic. After running a top command, I saw MySQL was using 160% CPU! Recently I've been…
Juddling
  • 4,594
  • 8
  • 34
  • 40
161
votes
1 answer

Why does “while(true)” without “Thread.sleep” cause 100% CPU usage on Linux but not on Windows?

I have created a simple program in java: public static void main(String[] args) throws InterruptedException { while (true) ; } If I run this on a Linux machine, it shows 100% CPU usage, but doesn't cause the OS to appear slow. …
Maniek
  • 1,293
  • 1
  • 9
  • 9
151
votes
24 answers

High CPU usage with Android emulator (qemu-system-i386.exe)

The emulator qemu-system-i386.exe cpu usage almost constantly running between 7~9 Android studio 2.1 Android SDK Tools: 25.1.3 Host Operating System: Windows 7 - i7 2630QM - 8GB Ram Intel x86 Atom System Image installed No matter what setting i…
skystar7
  • 4,419
  • 11
  • 38
  • 41
117
votes
5 answers

How to read the Stock CPU Usage data

On Ice Cream Sandwich, an option in the Developer Options is "Show CPU Usage", which adds an overlay on the screen (see screenshot below). My question is, how do I read the data ? I guessed that the package names are the process currently actives,…
XGouchet
  • 10,002
  • 10
  • 48
  • 83
101
votes
13 answers

How to calculate the CPU usage of a process by PID in Linux from C?

I want to programmatically [in C] calculate CPU usage % for a given process ID in Linux. How can we get the realtime CPU usage % for a given process? To make it further clear: I should be able to determine the CPU usage for the provided processid…
codingfreak
  • 4,467
  • 11
  • 48
  • 60
97
votes
12 answers

Android studio using > 100% CPU at all times - no background processes appear to be running

I've noticed Android Studio (when running) uses greater than 100% CPU at all times, even when it appears there are no background processes that the IDE is running (indexing, etc). I might suspect this were something specific to my box, but some…
Shaun
  • 1,539
  • 1
  • 12
  • 11
96
votes
8 answers

How is CPU usage calculated?

On my desktop, I have a little widget that tells me my current CPU usage. It also shows the usage for each of my two cores. I always wondered, how does the CPU calculate how much of its processing power is being used? Also, if the CPU is hung up…
Chris Laplante
  • 29,338
  • 17
  • 103
  • 134
93
votes
6 answers

VS2013 permanent CPU usage even though in idle mode

I've recently updated VS2013 to Update 1 and since then VS takes CPU usage to 25% (on a 4 cores intel i5 cpu) permanently even though it's supposed to be idle. I thought it has some unfinished background processes so I left it running for a while…
remus
  • 2,635
  • 2
  • 21
  • 46
82
votes
6 answers

Accurate calculation of CPU usage given in percentage in Linux?

It's a question which has been asked many times, however there is no well supported answer I could find. Many people suggest the use of top command, but if you run top once (because you have a script for example collecting Cpu usage every 1 second)…
Vangelis Tasoulas
  • 3,109
  • 3
  • 23
  • 36
79
votes
6 answers

How do I find out what is hammering my SQL Server?

My SQL Server CPU has been at around 90% for the most part of today. I am not in a position to be able to restart it due to it being in constant use. Is it possible to find out what within SQL is causing such a CPU overload? I have run SQL Profiler…
joshcomley
  • 28,099
  • 24
  • 107
  • 147
76
votes
3 answers

What is the correct Performance Counter to get CPU and Memory Usage of a Process?

How can I get the CPU and Memory usage of a particular process using the .NET PerformanceCounter class? And also what is the difference between Processor\% Processor Time and Process\% Processor Time? I am a bit confused between these two.
Anindya Chatterjee
  • 5,824
  • 13
  • 58
  • 82
69
votes
8 answers

How prevent CPU usage 100% because of worker process in iis

My CPU usage is 100% most of the the time in Windows Server 2008-R2 with my own vps, vmware, quad core, and 4GB Ram. When I open windows Task Manager and go to the resource monitor I see that 100% usage is because of workerprocess.exe. I have 3…
SilverLight
  • 19,668
  • 65
  • 192
  • 300
62
votes
6 answers

Get Memory Usage in Android

Is there any API by which we can get CPU or Memory usage of android? I have tried one code as below: package com.infostretch.mainactivity; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import…
Badal
  • 4,078
  • 4
  • 28
  • 28
1
2 3
99 100