Questions tagged [performancecounter]

PerformanceCounters are indicators for how much work a program does.

As a starting-point for windows:

1014 questions
91
votes
16 answers

How do you get total amount of RAM the computer has?

Using C#, I want to get the total amount of RAM that my computer has. With the PerformanceCounter I can get the amount of Available ram, by setting: counter.CategoryName = "Memory"; counter.Countername = "Available MBytes"; But I can't seem to find…
Joel
  • 15,576
  • 16
  • 69
  • 92
69
votes
2 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,369
  • 11
  • 54
  • 78
47
votes
2 answers

"Access to the registry key 'Global' is denied" when accessing performance counters

I'm attempting to read some performance counters from my ASP.NET application. When I do, I get the error "Access to the registry key 'Global' is denied." I have tried following the instructions here and here, using the user IIS…
Katie Kilian
  • 6,448
  • 5
  • 38
  • 60
46
votes
4 answers

C# Get used memory in %

I've created a performancecounter that can check the total memory usage in %, but the problem is that it doesn't give me the same value as in task manager shows me. for example: my program says 34% but task manager says 40%. Any ideas? NOTE I try to…
Yuki Kutsuya
  • 3,658
  • 8
  • 41
  • 56
44
votes
6 answers

What is the performance hit of Performance Counters

When considering using performance counters as my companies' .NET based site, I was wondering how big the overhead is of using them. Do I want to have my site continuously update it's counters or am I better off to only do when I measure?
Boaz
  • 21,983
  • 21
  • 65
  • 76
41
votes
4 answers

Install "perf" on Mac

I need the "perf" utility to monitor the program on my Mac. I know linux comes with it, but is it available on Mac? I am working on a OSX 10.9 Mavericks and tried "port search" for perf or linux-tools, but I couldn't get any results.
wlhee
  • 1,798
  • 3
  • 16
  • 18
40
votes
5 answers

Can a C# program measure its own CPU usage somehow?

I am working on a background program that will be running for a long time, and I have a external logging program (SmartInspect) that I want to feed with some values periodically, to monitor it in realtime when debugging. I know I can simply fire up…
Lasse V. Karlsen
  • 350,178
  • 94
  • 582
  • 779
39
votes
1 answer

What would make PerformanceCounterCategory.Exists hang indefinitely?

I've got an application that uses performance counters, that has worked for months. Now, on my dev machine and another developers machine, it has started hanging when I call PerformanceCounterCategory.Exists. As far as I can tell, it hangs…
driis
  • 151,614
  • 43
  • 262
  • 332
39
votes
4 answers

The requested Performance Counter is not a custom counter, it has to be initialized as ReadOnly

I am getting repeated errors about the ReadOnly property on performance counters whenever I try to debug a .NET windows service app. This app works fine on x86 windows vista, or x86 windows 2003. It's just stopped working on my new 64bit dev…
Andrew Matthews
  • 2,822
  • 2
  • 25
  • 40
36
votes
2 answers

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.NextValue() + "%"); The output is always 0%, while the…
smwikipedia
  • 52,824
  • 76
  • 267
  • 432
33
votes
6 answers

How to detect SqlServer connection leaks in a ASP.net applications?

I'm currently doing some GUI testing on a ASP.net 2.0 application. The RDBMS is SQL Server 2005. The host is Win Server 2003 / IIS 6.0. I do not have the source code of the application because it was programmed by an external company who's not…
33
votes
1 answer

PerformanceCounters on .NET 4.0 & Windows 7

I have a program that works fine on VS2008 and Vista, but I'm trying it on Windows 7 and VS2010 / .NET Framework 4.0 and it's not working. Ultimately the problem is that System.Diagnostics.PerformanceCounterCategory.GetCategories() (and other…
Scott Willeke
  • 7,869
  • 1
  • 35
  • 47
31
votes
3 answers

Using PerformanceCounter to track memory and CPU usage per process?

How can I use System.Diagnostics.PerformanceCounter to track the memory and CPU usage for a process?
Louis Rhys
  • 30,777
  • 53
  • 137
  • 211
30
votes
4 answers

How to measure program execution time in ARM Cortex-A8 processor?

I'm using an ARM Cortex-A8 based processor called as i.MX515. There is linux Ubuntu 9.10 distribution. I'm running a very big application written in C and I'm making use of gettimeofday(); functions to measure the time my application…
HaggarTheHorrible
  • 6,335
  • 16
  • 63
  • 79
29
votes
3 answers

About Linux NMI watchdog

Now I encounter a problem about Linux NMI Watchdog. I want to use Linux NMI watchdog to detect and recovery OS hang. So, I add "nmi_watchdog=1" into grub.cfg. And then check the /proc/interrupt, NMI were triggered per second. But after I load a…
silverbullettt
  • 768
  • 1
  • 9
  • 12
1
2 3
67 68