Thread overview | ||||||
---|---|---|---|---|---|---|
|
February 18, 2014 trace GC work | ||||
---|---|---|---|---|
| ||||
Hi, Is it possible to trace GC allocation calls to determine times of program "death" and have some stats? So i want the following information: - garbage collection starts at {time} - garbage collection stops at {time} - (optionally) gc took {time}, collected {size} bytes thanks. |
February 18, 2014 Re: trace GC work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ruslan Mullakhmetov | On 02/18/2014 10:10 AM, Ruslan Mullakhmetov wrote:
>
> Hi,
>
> Is it possible to trace GC allocation calls to determine times of
> program "death" and have some stats?
>
> So i want the following information:
> - garbage collection starts at {time}
> - garbage collection stops at {time}
> - (optionally) gc took {time}, collected {size} bytes
>
> thanks.
I may be totally off but I vaguely remember that it is possible to plug in one's own garbage collector. It should be possible to write a garbage collector that collects some statistics before calling back the default GC functions.
Ali
|
February 18, 2014 Re: trace GC work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ruslan Mullakhmetov | On Tuesday, 18 February 2014 at 18:10:40 UTC, Ruslan Mullakhmetov wrote: > > Hi, > > Is it possible to trace GC allocation calls to determine times of program "death" and have some stats? > > So i want the following information: > - garbage collection starts at {time} > - garbage collection stops at {time} > - (optionally) gc took {time}, collected {size} bytes > > thanks. I believe you'll have to modify the runtime to achieve this. See the "gc" folder[1]. An example of a custom garbage collector is in the "gcstub" folder[2]. Mike [1] https://github.com/D-Programming-Language/druntime/tree/e47a00bff935c3f079bb567a6ec97663ba384487/src/gc [2] https://github.com/D-Programming-Language/druntime/blob/e47a00bff935c3f079bb567a6ec97663ba384487/src/gcstub/gc.d |
February 19, 2014 Re: trace GC work | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike | On Tuesday, 18 February 2014 at 22:59:00 UTC, Mike wrote:
> On Tuesday, 18 February 2014 at 18:10:40 UTC, Ruslan Mullakhmetov wrote:
>>
>> Hi,
>>
>> Is it possible to trace GC allocation calls to determine times of program "death" and have some stats?
>>
>> So i want the following information:
>> - garbage collection starts at {time}
>> - garbage collection stops at {time}
>> - (optionally) gc took {time}, collected {size} bytes
>>
>> thanks.
>
> I believe you'll have to modify the runtime to achieve this. See the "gc" folder[1]. An example of a custom garbage collector is in the "gcstub" folder[2].
>
> Mike
>
>
> [1] https://github.com/D-Programming-Language/druntime/tree/e47a00bff935c3f079bb567a6ec97663ba384487/src/gc
> [2] https://github.com/D-Programming-Language/druntime/blob/e47a00bff935c3f079bb567a6ec97663ba384487/src/gcstub/gc.d
thanks, but i hoped it would be more graceful.
|
Copyright © 1999-2021 by the D Language Foundation