Questions tagged [performancecounter]

PerformanceCounters are indicators for how much work a program does.

As a starting-point for windows:

1051 questions
97
votes
18 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
  • 16,474
  • 17
  • 72
  • 93
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
58
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
  • 2,334
  • 4
  • 18
  • 19
52
votes
3 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,815
  • 5
  • 41
  • 64
51
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,968
  • 11
  • 46
  • 63
47
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
  • 25,331
  • 21
  • 69
  • 77
40
votes
2 answers

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
  • 161,458
  • 45
  • 265
  • 341
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
  • 380,855
  • 102
  • 628
  • 825
40
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
  • 3,006
  • 2
  • 29
  • 42
39
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
  • 34,517
  • 56
  • 153
  • 221
38
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
  • 61,609
  • 92
  • 309
  • 482
34
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…
34
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
  • 8,884
  • 1
  • 40
  • 52
31
votes
2 answers

Performance Counter by Process ID instead of name?

I am tracking multiple instances of the same application and need to get the memory and cpu use of both processes. However, I cant seem to figure out a way to use the performance counter and know which result is for which process. I have seen that I…
JeremyK
  • 1,075
  • 1
  • 22
  • 45
30
votes
2 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
  • 846
  • 1
  • 10
  • 13
1
2 3
69 70