cpu-usage

CPU Usage Spikes in WebSphere 6.1

First, just a bit of background: One of our customers is experiencing CPU usage spikes for WebSphere instances running one of our web apps (other instances with other apps are fine). They have a test environment and a live environment (both iSeries) which both experience the problem - with a single app per instance setup. We have deploy...

Capture CPU and Memory usage dynamically

I am running a shell script to execute a c++ application, which measures the performance of an api. i can capture the latency (time taken to return a value for a given set of parameters) of the api, but i also wish to capture the cpu and memory usage alongside at intervals of say 5-10 seconds. is there a way to do this without effecting...

How is CPU usage computed?

The Windows Task Manager shows CPU usage in percentage. What's the formula behind this? Is it this: % CPU usage for process A = (Sum of all time slices give to A till now)/ Total time since the machine booted Or is it something else? ...

How do I check my appplication's cpu usage (inside the app of course)?

Duplicate: http://stackoverflow.com/questions/278071/how-to-get-the-cpu-usage-c I have an application that is displaying stuff in real time. However, when the feed is giving too much info, my app will take up 100% of CPU. Other stuff is running too so I don't want that to happen. I know I can avoid this by storing the incoming data in...

CPU Utilization

Q1. What are best practices for a writing a code that does not consume CPU but still achieve a great performance? The question is very generic. What I seek over here is to list down different practices used for different environments? debugging tips besides process-monitor/task manager EDIT: I am not speaking of IO bound processes. I am...

Setting java to use one cpu

I have an application that has a license for a set number of cpus and I want to be able to set the number of cpus that java runs in to 1 before the check is done. I am running Solaris and have looked at pbind but thought that if I started the application and then used pbind it would have checked the license before it had set the number o...

How can I get CPU usage and/or RAM usage of a *THREAD* in C# (managed code)?

I know how to get CPU usage and memory usage for a process, but I was wondering how to get it on a per-thread level. If the best solution is to do some P-Invoking, then that's fine too. Example of what I need: Thread myThread = Thread.CurrentThread; // some time later in some other function... Console.WriteLine(GetThreadSpecificCpuUs...

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 but so much is going on it's difficult to tell if anything in particular is causing it....

Limit availableProcessors

I had a problem a while ago whilst using Solaris that I wanted to limit the number of CPUs that Java could see (that was returned by Runtime.getRuntime().availableProcessors(). I thought I had it and I was given some info for Linux and took it on faith. I was told that using taskset would limit the number of CPUs that java would use (whi...

how to controls the CPU usage of an app on OS X?

I'm running an application right now which seems to be running at full throttle, but even though the fan seems to be spinning at it's max and the activity monitor reports that the application is using 100% of the processor, I'm suspecting that at the most it is using 100% only of a single of the two cores on my machine. How can I tell O...

SQL Server 2005: Sharing processors accross multiple distributed instances

I have two instances of SQL Server 2005 running on two separate dedicated servers (let's call them DB1 and DB2). At the moment DB1 is very busy and DB2 is mostly idle. Is it possible to configure the instance running on DB1 to utilize the processor on DB2? For example, I connect to DB1 and execute "sp-heavy-going" and I would like DB1 ...

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 consume 100% of CPU usage, can I limit this usage programatically in code? This will certainly enable me to run multiple programs at a given ...

Method peaking my processor

Possible Duplicate: How do I start optimising my Java code? - CPU is at 100% I have a method isReset() that's executing like crazy i defined it as public boolean isReset() { return reset; } in another class. the class below is the only class that uses this code. import java.awt.BorderLayout; import java.awt.Dimension...

Slony-I replication CPU usage

Hi, I have recently had to install slony (version 2.0.2) at work. Everything works fine, however, my boss would like to lower the cpu usage on slave nodes during replication. Searching on the net does not reveal any blatantly obvious answers to this. Any suggestions that would help reduce CPU usage (or spread the update out over a longe...

Throttle application on the basis of per disk usage or CPU usage

Can anyone recommend a way in which I can throttle an application based on the current disk usage or even CPU usage. The application I am writing scans files on the hard disk and will be pretty hard disk intensive in itself. Can anyone recommend a way in which I can either throttle down my application(or even pause it for that matter) ...

any ideas to improve mouse responsiveness?

Hello everyone, I found when doing CPU intensive operations, for example, when I start a Windows Media Encoder to record full screen, all mouse operations on other applications especially double-click are not very responsive. I am looking for programming solutions to improve the mouse responsive. The only solution I could think of is t...

Why is multiplying cheaper than dividing?

I recently wrote a Vector 3 class, and I submitted my normalize() function for reviewal to a friend. He said it was good, but that I should multiply by the reciprocal where possible because "multiplying is cheaper than dividing" in CPU time. My question simply is, why is that? ...

nanosleep high cpu usage?

I noticed that a little test program which calls nanosleep is showing a huge difference in CPU usage when run on Linux machines with a kernel newer than 2.6.22. #include <time.h> int main (void) { struct timespec sleepTime; struct timespec returnTime; sleepTime.tv_sec = 0; sleepTime.tv_nsec = 1000; while (1) { ...

Profiling CPU usage of ASP.NET web app - but not the database!

I'm seeing consistently high CPU usage for my ASP.NET web application (on the live production box only, naturally....!) and I'm trying to narrow down the cause - it's basically maxing out a quad core Xeon box and there's no way it should be able to do that! The CPU usage of the web process is generally higher than that of the DB proces...

Session timeout error for ASP.net applications expires in 5 sec on one server & runs fine on another

Session timeout error for ASP.net applications expires in 5 sec whenever we login to website the session expires in 30 secs max & we are unable to save our work / submit our request from application. http://www.townplanning.in/ This is 3 year old website running on same server & now problem have started coming from past few days ........