Jump to content

Memory Allocation Nightmare


ApocalypeX

Recommended Posts

As all good thoughts mine was generated in the toilet. When a application or OS run they are allocated memory for use. This memory is used to store data like numbers, characters etc. When the memory is allocated it is taken from RAM or Virtual RAM. If the memory that's allocated isn't returned the memory is lost forever.Lets say I'm browsing on firefox that uses around 60MB of RAM and my pc randomly powers down. Do I lose 60mb + other allocated memory forever?

Link to comment
Share on other sites

I'm not quite sure that's how it works. Since the RAM chips are physical, I don't see how you could permanently lose them if they are only "lost" virtually. The computer does a check of physical inventory everytime it starts up, and that's where the OS gathers its information from about the hardware it reports to you. The RAM chips (unless faulty) should always report the same amount on startup.Try it. browse and then shut off the power to your computer. Turn it on. RAM reported during BIOS startup will be the same. And the OS will reflect the same.

Link to comment
Share on other sites

If the memory that's allocated isn't returned the memory is lost forever.
RAM is volatile, which means, it needs a constant current passing through it in order to retain its contents. When your computer is turned off, the RAM loses its power supply, and all the information it stored is lost instantly. When the computer is powered back on, you start all over again. So when memory leaks occur, that memory is lost "forever", but forever, in this case, is only until either the program ends or the power is turned off (depending on the type of system and the seriousness of the leak).Of course, it is different for non-volatile memory, which does retain data indefinitely. That's why you have things like defragmentation.
Link to comment
Share on other sites

The OS is not allotted memory, the OS is what does the allocation. The OS has direct access to all of the hardware, including the RAM. When a program starts up it asks the OS for memory, and the OS figures out how to allocate it. Memory management is a major part of the operating system, it includes the parts which swap data between RAM and virtual memory.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...