www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - GC stats

reply =?UTF-8?B?Ik3DoXJjaW8=?= Martins" <marcioapm gmail.com> writes:
Hello!

I was wondering if anyone has suggestions on the easiest way to 
time how long GC collections take? I haven't seen anything in the 
docs.

What I want is a clean non-intrusive way to log when a collection 
happened, how long my threads were stopped, how much total memory 
and how many blocks were recovered. i.e. how much garbage was 
created in between collections. Are there any hooks on the 
runtime?

Cheers,
-M
Jul 25 2015
parent reply "Martin Nowak" <code dawg.eu> writes:
On Saturday, 25 July 2015 at 17:34:26 UTC, Márcio Martins wrote:
 What I want is a clean non-intrusive way to log when a 
 collection happened, how long my threads were stopped, how much 
 total memory and how many blocks were recovered. i.e. how much 
 garbage was created in between collections. Are there any hooks 
 on the runtime?
http://dlang.org/changelog.html#gc-options https://github.com/D-Programming-Language/druntime/blob/1e25749cd01ad08dc08319a3853fbe86356c3e62/src/rt/config.d#L14
Jul 25 2015
parent reply "Gary Willoughby" <dev nomad.so> writes:
On Saturday, 25 July 2015 at 17:43:44 UTC, Martin Nowak wrote:
 On Saturday, 25 July 2015 at 17:34:26 UTC, Márcio Martins wrote:
 What I want is a clean non-intrusive way to log when a 
 collection happened, how long my threads were stopped, how 
 much total memory and how many blocks were recovered. i.e. how 
 much garbage was created in between collections. Are there any 
 hooks on the runtime?
http://dlang.org/changelog.html#gc-options https://github.com/D-Programming-Language/druntime/blob/1e25749cd01ad08dc08319a3853fbe86356c3e62/src/rt/config.d#L14
I thought there is a recently added compiler option that profiles the GC and creates a report now?
Jul 26 2015
next sibling parent "simendsjo" <simendsjo gmail.com> writes:
On Sunday, 26 July 2015 at 14:16:46 UTC, Gary Willoughby wrote:
 On Saturday, 25 July 2015 at 17:43:44 UTC, Martin Nowak wrote:
 On Saturday, 25 July 2015 at 17:34:26 UTC, Márcio Martins 
 wrote:
 What I want is a clean non-intrusive way to log when a 
 collection happened, how long my threads were stopped, how 
 much total memory and how many blocks were recovered. i.e. 
 how much garbage was created in between collections. Are 
 there any hooks on the runtime?
http://dlang.org/changelog.html#gc-options https://github.com/D-Programming-Language/druntime/blob/1e25749cd01ad08dc08319a3853fbe86356c3e62/src/rt/config.d#L14
I thought there is a recently added compiler option that profiles the GC and creates a report now?
Should be included in 2.068 I think: https://github.com/D-Programming-Language/druntime/blob/1e25749cd01ad08dc08319a3853fbe86356c3e62/src/rt/profilegc.d#L3
Jul 26 2015
prev sibling parent reply Martin Nowak <code+news.digitalmars dawg.eu> writes:
On 07/26/2015 04:16 PM, Gary Willoughby wrote:
 
 I thought there is a recently added compiler option that profiles the GC
 and creates a report now?
That's an allocation profiler, the other one mentioned by me reports GC stats as requested by the OP.
Jul 26 2015
parent =?UTF-8?B?Ik3DoXJjaW8=?= Martins" <marcioapm gmail.com> writes:
On Sunday, 26 July 2015 at 17:43:42 UTC, Martin Nowak wrote:
 On 07/26/2015 04:16 PM, Gary Willoughby wrote:
 
 I thought there is a recently added compiler option that 
 profiles the GC and creates a report now?
That's an allocation profiler, the other one mentioned by me reports GC stats as requested by the OP.
Thanks!
Jul 27 2015