Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Incorrect process IDs returned by WMI's Win32_PerfFormattedData_NETFramework_NETCLRMemory

$
0
0

I'm using WMI's Win32_PerfFormattedData_NETFramework_NETCLRMemory query to retrieve information about local .NET processes. It works fine for most processes, but a few processes return 0 for ProcessID (despite their real process ID is not 0).


			_searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PerfFormattedData_NETFramework_NETCLRMemory");
			foreach (var obj in _searcher.Get())
			{
				var properties = obj.Properties.Cast<PropertyData>().Select(val => string.Format("{0}={1}", val.Name, val.Value)).ToList();
				var message = string.Join(" ", properties);
				Console.WriteLine("{0} {1} {2}\r\n", obj["ProcessID"], obj["Name"], message);
			}

And getting:

0 WmiCollector.vshost AllocatedBytesPersec=0 Caption= Description= FinalizationSurvivors=0 Frequency_Object= Frequency_PerfTime= Frequency_Sys100NS= Gen0heapsize=0 Gen0PromotedBytesPerSec=0 Gen1heapsize=0 Gen1PromotedBytesPerSec=0 Gen2heapsize=0 LargeObjectHeapsize=0 Name=ServiceInformationCollector.vshost NumberBytesinallHeaps=0 NumberGCHandles=170 NumberGen0Collections=0 NumberGen1Collections=0 NumberGen2Collections=0 NumberInducedGC=0 NumberofPinnedObjects=0 NumberofSinkBlocksinuse=294 NumberTotalcommittedBytes=0 NumberTotalreservedBytes=0 PercentTimeinGC=0 ProcessID=0 PromotedFinalizationMemoryfromGen0=0 PromotedMemoryfromGen0=0 PromotedMemoryfromGen1=0 Timestamp_Object= Timestamp_PerfTime=Timestamp_Sys100NS=

Any ideas why this can be happening?



Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>