The app hanging after reach 1750MB of RAM

Suliman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Apr 19 00:28:32 PDT 2017


>> auto mymem = cargpspoints.length * 
>> typeof(cargpspoints[0]).sizeof;			
>> writeln(mymem);
>>
>> And it's print: 16963440
>> it's about 16MB...
>>
>> What is takes all other memory?
>
> 1. You're measuring it wrong. Array length is already measured 
> in terms of type size.

So should I do:
cargpspoints.length * cargpspoints[0].sizeof ?

Btw, `cargpspoints.length * typeof(cargpspoints[0]).sizeof` and 
`cargpspoints.length * cargpspoints[0].sizeof` show same result.


More information about the Digitalmars-d-learn mailing list