Bug 10101 - Perfomance counters for Generational GC do not work
Summary: Perfomance counters for Generational GC do not work
Status: RESOLVED ANSWERED
Alias: None
Product: Runtime
Classification: Mono
Component: GC ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-02-06 18:14 UTC by Sergey Zhukov
Modified: 2017-07-14 23:52 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED ANSWERED

Description Sergey Zhukov 2013-02-06 18:14:55 UTC
Generational GC counters do not work with sgen. 

How to reproduce: 
Create perfmon.config file with the following content:

<?xml version='1.0' encoding='UTF-8'?>
<mperfmon>
  <update interval="1000" />
  <set name="test">
    <counter cat=".NET CLR Memory" name="# Bytes in all Heaps" />
    <counter cat=".NET CLR Memory" name="Gen 0 heap size" />
    <counter cat=".NET CLR Memory" name="Gen 1 heap size" />
    <counter cat=".NET CLR Memory" name="Gen 2 heap size" />
  </set>
</mperfmon>

run any mono program mono-sgen <your_program> get the pid of the running process, than run mperfmon

mperfmon --report=test --config=perfmon.config --count=1000000 <pid>

All .NET CLR Memory counters are 0.

If you run program without mono-sgen, counters "# Bytes in all Heaps" and "Gen 0 heap size" will show non-zero values

The same result will be if you use Perfomance counters in the code of running program (so this is not the issue of mperfmon) 

Tested with mono 2.10.8.1 and mono 3.0.4
OS: Ubuntu 10.04/Ubuntu 12.04
Comment 1 Rodrigo Kumpera 2017-07-14 23:52:20 UTC
We don't support the dotnet counters, they are implementation specific.