I left my program open for 9 hours and it used up 700mb of ram, could someone review it?

Gan via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 27 11:59:07 PST 2015


On Tuesday, 27 January 2015 at 19:26:12 UTC, bearophile wrote:
> Gan:
>
>> Is there some special stuff I gotta do extra with structs? Do 
>> they need manually allocated and released?
>
> Most of your usages of tiny structs should be by value. So just 
> keep in mind they are values. Even when you iterate with a 
> foreach on a mutable array of them :-)
>
>
>> On a second question, do I ever need to manually release 
>> objects I create with new?
>
> Usually not. How much advanced do you want to be? :-)
>
> Bye,
> bearophile

Thanks. I'll give structs a try.

When I start the program, it runs fine at 35mb of ram. It only 
keeps 15 objects stored in the arrays at a time so why do you 
think my ram usage increases to 700+ after many hours?


More information about the Digitalmars-d-learn mailing list