Question:
what is meaning of memory allocation?
jitendra vishnoi
2008-02-05 05:55:58 UTC
in programing we listen about static memory allocation and dynamic memeory allocation. but what is the exact meaning of memory allocation. i want to know full cocept. u can tell me relaed site also.............
Six answers:
2008-02-05 06:04:45 UTC
Memory allocation is simply speaking the process of being allowed to use a certain amount of memory. Memory can be allocated before the program is run at compile time (static allocation) or as the program is running (dynamic allocation). Allocating memory statically doesn't cost any time at runtime but is much less flexible than dynamic memory allocation. Can I assume you are using a C-like language if you are learning memory allocation?



Suppose you want to store an array of numbers. We can use a decleration like:

int numbers[NUM_NUMBERS];

if we know in advance how many numbers there will be. This is static memory allocation, because at compile time, we know exactly how much memory we will need (in this case sizeof int * NUM_NUMBERS). Static memory is allocated on the Stack.



More often then not however, we don't know in advance how much memory we will need. If we don't know how many numbers the user will enter, we have to allocate memory at runtime. In C we would do this using something along the lines of calling malloc, which just asks the operating system to give us a pointer to a certain amount of memory. Dynamic memory is given from a different pool of memory called the Heap.



The exact mechanics of it all depends on your compiler and operating system but that is the gist of it. Look at the linked wiki articles for some more info or make another more specific question and we'll be happy to help.



Hope that helped!
?
2016-10-03 01:40:22 UTC
Allocate Meaning
abhinav sharma
2008-02-05 11:44:18 UTC
For any program to run you need some specific memory for storing variables or data structures or buffers for reading and writing files. The process of making this memory available is known as memory allocation. (It is not all the memory required to run the program.)



In Static allocation one decides while writing the code how much memory the program needs and puts that "hardwired" in the code.



In Dynamic allocation the programmer does not fix the amount of memory allowed to the program, rather puts the memory allocation in the program logic. As and when memory is required (or the programmer thinks at that step it would be required) it is allocated. The amount allocated depends on the parameters in that state of the program.



Lets take a simple analogy of a school student. You can say static allocation is like writing/working in a copy/notebook, wherein you decide before starting your work how many papers u will need. You take the copy accordingly and commit it all for that specific work. For your work u need to write/erase/rewrite within those pages.



Whereas dynamic allocation is working with loose sheets. You do not commit any number of sheets when u start, but you can add any number of sheets required at any time.



With both kinds of allocation it is necessary to keep track of how much memory is necessary and to free the unnecessary memory.



This whole process of allocation and freeing the unnecessary memory is known as memory management.



In C & C++ you always need to keep track of memory management while languages like Java do this on their own and the programmer need not worry about it.
2008-02-05 06:05:01 UTC
When PCs were born (and Im old enough to remember) it used to be called volatile and non volatile - meaning that volatile was there on the chip until re-written or PC turned off, and non was burned in to the chip. Typical non-vol (or static) are BIOS which no matter how modern, every PC needs the root instructions to power on.



You may know the terms RAM and ROM. Volatile memory is on RAM (random access) and non-vol is on ROM (read only). ROM cant be rewritten to (well it can - flash updates for example rewrite ROM but it is dangerous and only done with caution!) and stores info needed all the time - dishwashers, TVs, washing machines have ROM chips to remember settings for example.



Windows also used virtual memory - as in the old days, when memory wasnt very big the PC would write memory to the hard drive when the chip was full. This is what caused slow PCs in the old days. As a techie that was my biggest call out as hard drive is far slower than RAM.



Hope that explains it.
2008-02-05 06:01:50 UTC
memory allocation is ur computers programmed priorities on how much memory it will use on a certain program to run it.



example: u put program a with a low priority in memory, it will most likely run slow and quite sluggish but ur pc will hardly feel the effect of having a program running



if u put some program high priority, it will be faster, but ur pc might get slower, depending on ur specs. it will also prioritize what ur pc will open first.
steven m
2008-02-05 06:03:11 UTC
the amount of memory needed to process a task

Like open a new window once the icon has been clicked on



Or to save and close a document



This is just a guess, but it sounds about right



Or search here - one of these might be more to your taste

http://search.yahoo.com/search?search=memory+allocation+pc&ei=UTF-8&fr=ks-ans&ico-yahoo-search-value=http%3A%2F%2Frds.yahoo.com%2F_ylt%3DAm6JlrIGxAWfO0tEb_xdwHYazKIX%3B_ylv%3D0%2FSIG%3D11iebec11%2FEXP%3D1202306349%2F*-http%253A%2F%2Fsearch.yahoo.com%2Fsearch&ico-wikipedia-search-value=http%3A%2F%2Frds.yahoo.com%2F_ylt%3DAsBs7CyOkCINuXfrfncs.g0azKIX%3B_ylv%3D0%2FSIG%3D121uhr138%2FEXP%3D1202306349%2F*-http%253A%2F%2Fen.wikipedia.org%2Fwiki%2FSpecial%253aSearch&p=memory+allocation+pc


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...