<swornavidhya.mahadevan@[EMAIL PROTECTED]
> wrote in message
news:4fb3e23e-d0fb-4b40-a3b9-cd8dfe957dd6@[EMAIL PROTECTED]
> Which allocation (Static / Dynamic) is suitable for the situation when
> we are trying to allocate for a overloaded memory when the memory is
> full and no space to allocate.
> What will happen if both the allocation is impossible.
>
static memory is good for fixed-memory buffers (it will never need to be
freed or made any larger).
however, note that static memory is also allocated as a part of the app's
initial process image, so it will either be available, or the app will
fail
somehow early in app startup (like, an app that as soon as you try to
start
it, either the OS refuses to load it, it crashes, or the OS crashes).
also note that, because of the fixed nature of static memory, what is
located there can't be used by elsewhere (it is like putting a big crate
in
ones' house... one can put things in the crate, but otherwise this space
is
unusable, and would one rather have a house full of empty space, or filled
with odd-sized crates?...).
one is either limited by all these odd-sized crates, or all of these
crates
form a big horrible mess...
otherwise, dynamic memory is a lot more adaptable, and I would recommend
this as a general rule unless one has some specific reason to use large
static buffers.
after all, if dynamic memory were not useful, why would it have been
implemented and used in the first place, when static memory is so much
simpler?...
> Sworna vidhya


|