Discussion on Go and D

deadalnix deadalnix at gmail.com
Fri Apr 6 11:06:34 PDT 2012


Le 06/04/2012 20:01, Walter Bright a écrit :
> On 4/6/2012 10:37 AM, Rainer Schuetze wrote:
>> I hope there is something wrong with my reasoning, and that you could
>> give me
>> some hints to avoid the memory bloat and the application stalls.
>
> A couple of things you can try (they are workarounds, not solutions):
>
> 1. Actively delete memory you no longer need, rather than relying on the
> gc to catch it. Yes, this is as unsafe as using C's free().
>
> 2. Null out pointers & references when you are done with them. This
> helps reduce unwanted pinning of unused gc memory.
>
> 3. Minimize use of global memory, as that is a major source of source of
> roots.

Additionally, recycle objects (this is a common practice in java when 
performance matters).


More information about the Digitalmars-d mailing list