Export GC Usage Statistics on Request for Profiling

tcak via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 15 12:42:01 PDT 2016


On Friday, 15 July 2016 at 17:04:35 UTC, Andrei Alexandrescu 
wrote:
> On 07/15/2016 12:31 PM, tcak wrote:
>>> Do you know about --profile=gc?
>>
>> 1. Never worked for me in a multithreaded program.
>
> Could you please give it another look. Walter fixed it 
> relatively recently.
>

Hmm, I will check it out. Haven't tested it for a while.

>> 2. I am not able to retrieve that data on runtime by another 
>> application
>> to see close to real-time statistics.
>>
>> I know that profiling data is kept in memory, and written to 
>> file at the
>> end of program. Instead it could write it to a file descriptor 
>> and not
>> care about whether a program is reading it. Let the kernel 
>> handle that
>> part.
>
> Wouldn't that make things too slow to be practical? The other 
> profilers I know of also keep counters in memory.
>
>
> Andrei

If it is about speed, we can still use a public shared memory for 
that purpose. So, statistical messages can be written in shared 
memory, and other program reads from that to get those messages. 
A suitable communication protocol can be implemented in way. At 
the end, our purpose is to provide powerful toys to ease 
development.


More information about the Digitalmars-d mailing list