cpu-usage

Best way to slow down a thread? Is using Sleep() OK?

I've written a C++ library that does some seriously heavy CPU work (all of it math and calculations) and if left to its own devices, will easily consume 100% of all available CPU resources (it's also multithreaded to the number of available logical cores on the machine). As such, I have a callback inside the main calculation loop that s...

How do I get per-cpu stats (system, idle, nice, ...) like the "top" command does?

On linux, I'd like to know what "C" API to call to get the per-cpu stats. I know about and could read /proc/loadavg from within my app, but this is the system-wide load avarages, not the per-cpu information. I want to tell the individual CPUs or cores apart. As an example of an application that does this, When I run top and press "1",...

[C#] Why the cpu performance counter kept reporting 0% cpu usage?

Here is my code snippet: PerformanceCounter cpuload = new PerformanceCounter(); cpuload.CategoryName = "Processor"; cpuload.CounterName = "% Processor Time"; cpuload.InstanceName = "_Total"; Console.WriteLine(cpuload.NextValue() + "%"); But the output is always 0%, while the cpuload.RawValue is ...

How to get CPU utilization on jsp

I need to get the cpu usage of the current process using jsp. My scenario is like when user navigate from one page to other I need to check the cpu utilization, memory usage of the process. ...

Should a non-blocking code push CPU to 100%

I've been thinking today about NodeJS and it attitude towards blocking, it got me thinking, if a block of code is purely non-blocking, say calculating some real long alogirthm and variables are all present in the stack etc.. should this push a single core non hyperthreaded to CPU as Windows Task Manager defines it to 100% as it aims to c...

Solaris CPU run queue

Is there a command which can tell me whats in the Solaris run queue? I can get a count using vmstat, but I need to know what processes/threads are in there. ...

jffs2_gcd_mtd1 CPU load

On debian/ubuntu9 What is jffs2_gcd_mtd1 and why is it using CPU so extensively? Is it related to apache or mysql continuous usage? ...

how to analyze Query CPU time

Hello, How can I analyze the CPU time consumed by my Innodb queries? I have innotop, but I cant seems to find where it is. Thanks. ...

100% cpu usage in xml/xslt driven asp.net web app

The web app uses XML from a web service, which is then transformed to HTML using XSLT. The app uses a HttpModule to get the XML using AddOnPreRequestHandlerExecuteAsync. Classes Used: XmlDocument - stores the xml. XslCompiledTransform - stores the transform, is cached in Application. Asynchronous HttpWebRequest using BeginGetResponse/E...

Hyper-V, VMware ESX and custom power management

In a research project involving virtualization and power management I am testing various resource allocation scenarios and custom power management algorithms. I am interested in isolating a virtual machine to use only a certain CPU core. I was thinking about using Windows 2008R2 and Hyper-V, but Hyper-V does not allow setting CPU affin...

Running tasks in the background with lower CPU priority

I have a feature in my CMS that allows a user to upload a zip file full of images and the server will extract them and insert each one into an image gallery. I've noticed that this grinds up the CPU quite severely and causes other requests to slow down. I'm thinking of using the delayed_job plugin to delegate each image addition into th...

Limit the cpu usage of a windows .NET service

Hi all, is there any way to throttle the cpu usage of a windows service that is written in .NET, either inside the service code or outside. Setting the current thread to the lowest priority is not an option but as soon as exceptions start to occur the cpu load goes up, is it possible to limit this? thx in advance, greetings ...

Why is mscorsvw.exe maxing out my CPU?

I installed my .NET windows service and right after installing I noticed mscorsvw.exe maxing out my CPU; this happens when I do a new install of my service. Why is mscorsvw "interfering" with my windows service? ...

debugging JBoss 100% CPU usage

Originally posted on Server Fault, where it was suggested this question might better asked here. We are using JBoss to run two of our WARs. One is our web app, the other is our web service. The web app accesses a database on another machine and makes requests to the web service. The web service makes JMS requests to other machines, aggr...

How to get CPU usage statistics on Android?

I want to get the overall CPU usage on Android, similar to what Windows' Task Manager does. I can parse the output of the top program included in Android, but if there is a API call that does the same thing, it would be better. Any pointers? ...

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 usage spikes for a very short time? ...

Java reduce CPU usage

Greets- We gots a few nutters in work who enjoy using while(true) { //Code } in their code. As you can imagine this maxes out the CPU. Does anyone know ways to reduce the CPU utilization so that other people can use the server as well. The code itself is just constantly polling the internet for updates on sites. Therefore I'd im...

How to export Instrument's CPU Monitor's statistics to be usable in Excel or Numbers?

I require statistics of CPU Load of my iPhone apps. I am trying to use Instrument to see the CPU Load, but all I see in Instrument program is rendered graphs. I need these statistics data in raw numbers so that I can put all of them on graphs using Excel or Numbers. Is there a way to export these data in such a way? Or do I need other pr...

Huge CPU usage difference for the same .NET 4 program on different machines

I have two servers, one running core i7 920 (8 logic CPUs at 2.8Ghz), the other running Xeon X3430 (4 logic CPUs at 2.4Ghz). For the same .NET 4 application, CPU usage on the first machine is 6%; on the second machine it is 50%! I wonder what makes this huge difference. And how can I diagnose the cause of the issue? ...

Jquery CPU usage

I am using Jquery to make an image scroll across my page horizontally. The only problem is that it uses a serious amount of cpu usage. Up to 100% on a single core laptop in firefox. What could cause this??? Jquery <script> jQuery(document).ready(function() { $(".speech").animate({backgroundPosition: "-6000px 0px"}, 400000, n...