On Tuesday, May 2, 2017 at 1:01:37 AM UTC-4, Michael Press wrote:
> In article <
5afb59bd-da15-4da8...@googlegroups.com>,
> Some dued <
theodo...@gmail.com> wrote:
>
> > It'd be awfully wasteful for every application to claim its maximum possible memory requirement immediately upon launch. Also tools like web browsers are unpredictable as they depend on the sites, number of tabs etc...
>
> First of all it is virtual.
You are saying virtual like it means cost-free. If that was the case there would be no need to pre-allocate memory, because none of the later allocations would fail.
> Second, a unit has other constraints besides memory
> that give a good idea of how much memory it will
> need. If a logical unit does not know how much memory
> it will need, how will anybody else?
A networking stack (which I work on) can have widely varying memory needs based on traffic (including what the web browsers are doing). We do preallocate chunks at a time and dole them out to components in pieces, but not all at once.
And memory leaks suck. The only thing harder to debug is overlays.