Skip to main content

Questions tagged [cpu-usage]

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

cpu-usage
Filter by
Sorted by
Tagged with
259 votes
11 answers
366k views

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 ...
user avatar
235 votes
22 answers
552k views

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 ...
Supertux's user avatar
  • 8,248
210 votes
3 answers
434k views

MySQL high CPU usage [closed]

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 ...
Juddling's user avatar
  • 4,670
161 votes
1 answer
8k views

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, ...
Maniek's user avatar
  • 1,293
155 votes
24 answers
76k views

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 ...
skystar7's user avatar
  • 4,547
117 votes
5 answers
114k views

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 ...
XGouchet's user avatar
  • 10.2k
103 votes
13 answers
182k views

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 ...
codingfreak's user avatar
  • 4,575
101 votes
8 answers
103k views

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 ...
Chris Laplante's user avatar
99 votes
12 answers
65k views

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 ...
Shaun's user avatar
  • 1,559
93 votes
6 answers
27k views

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 ...
remus's user avatar
  • 2,670
83 votes
6 answers
114k views

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 ...
Vangelis Tasoulas's user avatar
79 votes
6 answers
192k views

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 ...
joshcomley's user avatar
  • 28.6k
78 votes
5 answers
75k views

Memory usage of Docker containers

I am using Docker to run some containerized apps. I am interested in measuring how much resources they consume (as far as regarding CPU and Memory usage). Is there any way to measure the resources ...
Paris's user avatar
  • 6,651
77 votes
3 answers
145k views

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 ...
Anindya Chatterjee's user avatar
69 votes
8 answers
291k views

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% ...
SilverLight's user avatar
  • 20.2k
63 votes
13 answers
57k views

How can I programmatically limit my program's CPU usage to below 70%?

Of late, I'm becoming more health oriented when constructing my program, I have observed that most of programs take 2 or 3 minutes to execute and when I check on the task scheduler, I see that they ...
Nidhi's user avatar
  • 707
63 votes
4 answers
10k views

Some fundamental but important questions about web development?

I've developed some web-based applications till now using PHP, Python and Java. But some fundamental but very important questions are still beyond my knowledge, so I made this post to get help and ...
Zhu Tao's user avatar
  • 7,619
62 votes
6 answers
109k views

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....
Badal's user avatar
  • 4,168
61 votes
7 answers
132k views

High CPU Utilization in java application - why?

I have a Java Application (web-based) that at times shows very high CPU Utilization (almost 90%) for several hours. Linux TOP command shows this. On application restart, the problem goes away. So to ...
Jasper's user avatar
  • 8,620
60 votes
15 answers
34k views

Command line command to auto-kill a command after a certain amount of time

I'd like to automatically kill a command after a certain amount of time. I have in mind an interface like this: % constrain 300 ./foo args Which would run "./foo" with "args" but automatically kill ...
dreeves's user avatar
  • 26.8k
55 votes
7 answers
97k views

How to get total cpu usage in Linux using C++

I am trying to get total cpu usage in %. First I should start by saying that "top" will simply not do, as there is a delay between cpu dumps, it requires 2 dumps and several seconds, which hangs my ...
David Polák's user avatar
  • 1,651
52 votes
4 answers
167k views

Prometheus - Convert cpu_user_seconds to CPU Usage %?

I'm monitoring docker containers via Prometheus.io. My problem is that I'm just getting cpu_user_seconds_total or cpu_system_seconds_total. How to convert this ever-increasing value to a CPU ...
M156's user avatar
  • 1,124
49 votes
3 answers
49k views

Get CPU usage from application on iOS

How do I obtain CPU usage for an application? It's definitely possible, because there are application in App store (Activity Monitor Touch) which can show it.
ivanzoid's user avatar
  • 6,012
43 votes
6 answers
25k views

Simulate steady CPU load and spikes

How could I generate steady CPU load in C#, lower than 100% for a certain time? I would also like to be able to change the load amount after a certain period of time. How do you recommend to generate ...
kjv's user avatar
  • 11.3k
42 votes
9 answers
11k views

Visual Studio 2013 Update 2 maxes out core

I recently installed Visual Studio 2013 Professional Update 2 on a Windows 7 virtual machine. I had been running VS 2012 with no problems, but I wanted to upgrade. Everything was working well for a ...
Clint Powell's user avatar
  • 2,388
41 votes
6 answers
17k views

I need a slow C# function

For some testing I'm doing I need a C# function that takes around 10 seconds to execute. It will be called from an ASPX page, but I need the function to eat up CPU time on the server, not rendering ...
Sisiutl's user avatar
  • 4,955
41 votes
5 answers
67k views

what are the meaning of values at proc/[pid]/stat?

I was trying to develop an app to get CPU usage per app and kill apps when consuming much CPU. But I couldn't figure out how to do this. I have read this post and have seen this answer. So I looked ...
Shafin Abrar's user avatar
39 votes
5 answers
66k views

c# calculate CPU usage for a specific application

I'm trying to figure out how to get the CPU usage for a particular process but can only find information relating to overall CPU usage. Does anyone know how to extract the current CPU usage in ...
Grant's user avatar
  • 11.3k
39 votes
2 answers
29k views

Why the cpu performance counter kept reporting 0% cpu usage?

PerformanceCounter cpuload = new PerformanceCounter(); cpuload.CategoryName = "Processor"; cpuload.CounterName = "% Processor Time"; cpuload.InstanceName = "_Total"; Console.WriteLine(cpuload....
smwikipedia's user avatar
  • 63.3k
39 votes
7 answers
31k views

CPU Intensive Calculation Examples?

I need a few easily implementable single cpu and memory intensive calculations that I can write in java for a test thread scheduler. They should be slightly time consuming, but more importantly ...
MEURSAULT's user avatar
  • 8,649
36 votes
3 answers
49k views

What counts as CPU Intensive tasks (eg. sorting, searching etc?) [closed]

What do you count as a CPU intensive task. In terms of ... an algorithm/code for example (not so much a use case like video editing etc). Reason is it seems the main reason not to use NodeJS something ...
Jiew Meng's user avatar
  • 86.5k
36 votes
7 answers
42k views

Monitor cpu usage per thread in java?

I would like to ask whether there is some simple way to determine cpu usage per thread in java. Thanks
awk's user avatar
  • 526
35 votes
7 answers
24k views

jQuery animate() and browser performance

I've got some elements that I'm moving across the page very slowly. Essentially, I'm decreasing the left margin of two images over a span of 40 seconds or so. Visually, it's working beautifully. ...
Jeremy Ricketts's user avatar
32 votes
5 answers
56k views

How to get CPU usage and RAM usage without exec?

How does VBulletin get the system information without the use of exec? Is there any other information I can get about the server without exec? I am interested in: bandwidth used system type CPU speed/...
TeAmEr's user avatar
  • 4,753
32 votes
9 answers
55k views

How to get current CPU and RAM usage in C++?

is it possible, in C++, to get the current RAM and CPU usage? Is there a platform-indepentent function call?
tunnuz's user avatar
  • 23.7k
31 votes
4 answers
10k views

What is the meaning of Incl CPU Time, Excl CPU Time, Incl Real CPU Time, Excl Real CPU Time in traceview?

1) Exclusive time is the time spent in the method 2) Inclusive time is the time spent in the method plus the time spent in any called functions 3) We refer to calling methods as "parents" and called ...
VISHAL VIRADIA's user avatar
31 votes
3 answers
26k views

Chrome Headless puppeteer too much CPU

I have a scraping algorithm in nodejs with puppeteer which scrapes 5 pages concurrently and when it finishes with one page it pulls the next url from a queue and open it in the same page. The CPU is ...
Pjotr Raskolnikov's user avatar
31 votes
2 answers
40k views

Docker stats with CPU percentage more than 100

I have a question about docker stats command if anyone can help me. I am new in Docker area and I want to monitor the cpu usage of a docker container. The physical machine has 8 cores (CPU0...CPU7). I ...
SMA's user avatar
  • 443
30 votes
4 answers
29k views

Get Docker Container CPU Usage as Percentage

Docker provides an interactive stats command, docker stats [cid] which gives up to date information on the CPU usage, like so: CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O ...
Dan LaManna's user avatar
  • 3,481
30 votes
4 answers
63k views

Get current CPU, RAM and Disk drive usage in C#

How to get the CPU, RAM and Disk drive usage of the system in C# code?
Sauron's user avatar
  • 16.8k
29 votes
3 answers
76k views

Limit total CPU usage in python multiprocessing

I am using multiprocessing.Pool.imap to run many independent jobs in parallel using Python 2.7 on Windows 7. With the default settings, my total CPU usage is pegged at 100%, as measured by Windows ...
Dave Kielpinski's user avatar
27 votes
4 answers
30k views

efilogin-helper running continuously at high cpu on MacBook Pro [closed]

There is a process launched by launchd called efilogin-helper running as root, which is continuously running at high CPU load (60% to 120%) Do you know what this process is and how I can get it under ...
T33C's user avatar
  • 4,411
27 votes
5 answers
7k views

Simple TextView.setText causes 40% CPU Usage

Running my application causes ~40% CPU usage on my Phone: final String position = String.format("%02d:%02d:%02d", time.getHours(), time.getMinutes(), time.getSeconds()); getActivity()....
phlebas's user avatar
  • 1,210
26 votes
5 answers
18k views

Enable Live Graph in Memory Usage while Debugging in Visual Studio

Somehow I have lost the live graph from my Visual Studio Diagnostic Tool. Below is my current debugging screen showing that I can not see Memory and CPU usage live graph : Where as I am looking for ...
Рахул Маквана's user avatar
26 votes
1 answer
29k views

Limiting a Docker Container to a single cpu core

I'm trying to build a system which runs pieces of code in consistent conditions, and one way I imagine this being possible is to run the various programs in docker containers with the same layout, ...
mavix's user avatar
  • 2,548
25 votes
2 answers
30k views

Redis performance on a multi core CPU

I am looking around redis to provide me an intermediate cache storage with a lot of computation around set operations like intersection and union. I have looked at the redis website, and found that ...
Love Hasija's user avatar
  • 2,558
25 votes
5 answers
4k views

Write code to make CPU usage display a sine wave

Write code in your favorite language and let Windows Task Manager represent a sine wave in CPU Usage History. This is a technical interview quiz from Microsoft China. I think it's a good question....
MGC's user avatar
  • 495
25 votes
3 answers
50k views

Limit the memory and cpu available for a user in Linux

I am a little concerned with the amount of resources that I can use in a shared machine. Is there any way to test if the administrator has a limit in the amount of resources that I can use? And if ...
Eduardo's user avatar
  • 20.7k
24 votes
5 answers
26k views

CPU and memory usage of jemalloc as compared to glibc malloc

I had recently learnt about jemalloc, it is the memory allocator used by firefox. I have tried integrating jemalloc into my system by overriding new and delete operator and calling the jemalloc ...
deb's user avatar
  • 661
24 votes
7 answers
37k views

How to get the cpu usage per thread on windows (win32)

Looking for Win32 API functions, C++ or Delphi sample code that tells me the CPU usage (percent and/or total CPU time) of a thread (not the total for a process). I have the thread ID. I know that ...
Dirk Paessler's user avatar

1
2 3 4 5
59