Usage of memory by arrays

unDEFER undefer at gmail.com
Thu Apr 5 22:50:08 UTC 2018


On Thursday, 5 April 2018 at 22:23:12 UTC, Steven Schveighoffer 
wrote:
> 1. Compare to C malloc-ing 1.2MB at once (GC uses C malloc 
> underneath)

Yes after initialize malloc'ed 1.2Mb in C it consumes 1.6 Mb. 4.8 
Mb => 4.9 Mb

> 2. Have you examined smaller numbers for total? Does it scale 
> linearly or is there a threshold? (my guess is the latter)

OK, if total = 1000 the last test shows 12916 Kbytes. It's fine.

> Note that the GC does keep some metadata, but it's 1/32 the 
> size of the actual memory, so I'm not sure it's relevant here.
>
> Is there an end goal for this exercise? That is, did you find a 
> problem and are trying to diagnose it by using this test? Maybe 
> if we know the real problem you are having, it can be explained 
> differently.

I just don't like that my game application takes too much memory.
I will think more.


More information about the Digitalmars-d mailing list