问题
I'm trying to perform some memory profiling on an applications that is accumulating large amounts of memory.
I have found this tool (CLRProfiler): http://msdn.microsoft.com/en-us/library/ff650691.aspx
But it does not seem to be working. When I run it, it sits forever at "Waiting for application to start common language runtime".
Any other suggestions on how I can profile memory in C#?
回答1:
Check out Redgate:
http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/
回答2:
If you work with W7 or Vista, start it as administrator (File->ContextMenu->Run as Administrator). As already said by others, also check out to use the correct version.
回答3:
You are probably using the wrong version!
The new (v4.0) version is at http://www.microsoft.com/en-us/download/details.aspx?id=16273, which is working well for me (and it's free).
回答4:
If your project is set to build x86, then you have to use the 32 bit version, even if your OS is 64 bit.
回答5:
You can use a commercial product like ants memory profiler (red-gate) or dotTrace (jetbrains).
Both are very easy to get started with.
来源:https://stackoverflow.com/questions/6144084/c-sharp-memory-profile