Constant GC allocations when sending large messages to threads?

cc cc at nevernet.com
Fri Jan 31 07:14:30 UTC 2020


On Wednesday, 29 January 2020 at 21:10:53 UTC, Steven 
Schveighoffer wrote:
> I'm pretty sure std.concurrency uses Variant to pass message 
> data, which boxes when it gets over a certain size. You are 
> probably crossing that threshold.
>
> The allocations should level out eventually when the GC starts 
> collecting them.
>
> -Steve

Is there a way to pre-allocate a buffer or something to be used?  
Ideally I'd like to avoid too many garbage collections happening, 
in my application these thread messages happen almost every frame 
and are quickly adding up to 100s of kilobytes in allocations 
every few seconds.


More information about the Digitalmars-d-learn mailing list