[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory size and allocation





Jiri Svoboda:
> When a program(process) terminates, the operating system
> automatically frees all memory that was allocated by the program. You
> don't have to care about anything.
This this interesting.

> You may still want to free any unused memory as soon as possible.
> Then you should free the blocks using the program's data structures.
I do that.
I free memory blocks as soon as the program recognizes they have not been 
used in the last.. say 10 seconds, paying no attention to their sizes.


Mads Bondo Dydensborg:
>Actually it may have effects, from what kind of optimizations the compiler
>can make, to cache coherency effects. Doing what you sugggest will most
>likely improve the resulting binary AFAIK.
Hope so.


Thank you,
Francesco