What is virtual memory

295 views

Just found the RAM plus setting on my phone and dont get how it works, what does it do and what do I set it to

In: 2

8 Answers

Anonymous 0 Comments

Virtual memory is used for swapping stuff out of the main memory for not in use stuff, like apps that are open but not used, etc.

Anonymous 0 Comments

RAM is expensive. Mass storage (hard drive/flash) is relatively cheaper. You typically have at least an order of magnitude more mass storage than RAM.

Virtual memory is where you usemass storage as RAM. This gives your computer device virtually as much RAM as you need. The downside is that mass storage is MUCH slower to access than RAM.

When you run out of RAM, the CPU may move a portion of RAM not currently being used to this virtual RAM space–freeing up some real RAM. If the CPU needs access to something it put in virtual RAM it will move something not immediately needed into virtual RAM and replace it with the needed data from from the virtual RAM. As long as virtual RAM access is only occasional, this will be relatively transparent to the user. If heavy access of virtual RAM is required, then your computing device will noticeably show as your CPU swaps data in and out of virtual RAM.

Anonymous 0 Comments

Virtual memory means that the system is running low on available ram (actual memory) and is using part of the storage (hard drive) as if it were additional memory. Using virtual memory comes at the expense of speed as RAM chips are significantly faster than swapping things in and out of the storage drive.

Anonymous 0 Comments

It is when the active RAM gets temporarily stored on the harddrive. This allows the computer to use the RAM for another task but quickly load up what you were working on earlier.

Imagine you have 16 GB of RAM, and are using a big photoshop image that is using 15GB of ram. You take a break and open up Chrome, which uses 14GB of ram. The computer stores your photoshop file temporarily on the hard drive so Chrome can use the RAM. When you go back to photoshop, it can simply pick up where you left off quickly.

Anonymous 0 Comments

There are 2 types of storage for a computer/phone.

First, is memory, or RAM. The key thing with RAM is that it’s very quick. The downside to RAM is it is expensive to make $-wise, and when you turn off the power, the contents are lost. Computers use RAM to store short-term stuff, like the contents of a text box, or the picture of the Reddit robot while doom scrolling.

The second type, is non-volatile data storage, which used to be called hard disk space, or disk space, or storage. Those terms don’t really apply anymore as technology has moved away from spinning magnets, to flash memory, and stuff I’ve never heard of before. But the key feature is it’s cheap (relative to RAM), and it sticks around after you turn off the power. This is for your permanent stuff, like music you want to listen to while offline, selfies, or your taxes.

Sometimes, if you’re doing a lot of stuff, like looking at pictures of HD cats, while downloading spicy videos, at the same time as you’re calculating your taxes, your computer/phone needs more RAM than it physically has.

Virtual Memory uses your non-volatile data storage to act like RAM. So the temporary variables are stored long-term on your hard disk, or whatever tech you have. This is slower than using actual RAM, but it lets you keep working instead of forcing your system to crash or force you to close some windows.

In general, you should leave the factory default settings.

Anonymous 0 Comments

Virtual memory is a feature for most OS’s that helps them manage the fact that sometimes you simply dont have enough physical RAM for everything.

running out of ram is bad and if no measure is taken against it the system WILL crash the moment you got even one bit over the limit

when ram usage in the system is reaching its limit the OS preemptively sets up a special file in your storage know nas a “page file”(in windows systems htis file is actually called “pagefile.sys”) that is then uses ot “page” less used sections of th e ram contents into this file in order ot free up physical memory. this page file is treated as Extra RAM and is accessed as such(this matters, keep reading). for windows system this file is also where the memory dump is written into in the event of a fatal error(a blue screen).

The upside?: your system is safe from crashing due ot lack of memory and outside of certain fringe cases this is seamless.

The Downside?: Storage memory is never gonna be as fast as RAM so youll notice a significant slowdown in read/writing + the CPU cycles required ot do this.The process of moving items into and out of the page file also isnt instant+ modern system adapt this file size on the fly which can be an issue for older systems.

it is possible ot disable the pagefile in most system but this is not recommended, the way however you cna mitigate its use is by expanding the amount of physical ram to be more in tune with your use case.

Anonymous 0 Comments

RAM is like your phone’s short term memory. It actively uses it to store data that it currently works with, but like your brain, there’s only so much it can store simultaneously.

Virtual memory is similar to when you write things down while working so you don’t forget them. It’s much slower to look things up that you wrote down than it is to quickly remember them, but forgetting would be really bad for the apps you’re using.

When your phone thinks that its RAM won’t be enough it will write some stuff out to your internal storage (same place that stores pictures, apps and files) temporary, stuff that it thinks it won’t need anytime soon.

Anonymous 0 Comments

Unfortunately, all the answers so far have been incomplete.

In order for a program to use memory, it has to refer to them by an *address*, which is just a number that points to one particular part of memory. So a program might read from address 1234, add 10 to it, and write the result to address 3456.

The problem with that is two-fold:

– Some addresses are special. For example, it might be used to communicate with a peripheral, like a USB port. So inadvertently writing to that special address might end up sending it to your mouse, which might cause it to do weird things.
– If you want to run more than one program at a time, they would have to share memory. They can cooperate and not trample over each other’s assigned memory, but it’s still a bad idea for privacy if a random game you downloaded can potentially read the data in your banking app.

So, virtual memory is a set of memory addresses (i.e., an “address space”) that’s set up by the operating system for you. To protect everybody, the virtual memory presented to one app would not map it to the special peripheral communication addresses, and would not map it to RAM that other apps are using. So the game’s address 1234 might be referring to an entirely different physical location than the banking app’s address 1234, because both their address spaces are now virtual. It’s much more convenient to write each app now because you don’t have to worry about trampling over somebody else.

From here, you can then implement the memory swapping trick that others are talking about. The OS can give each app a lot of address space but not actually map any of it to real RAM. When your app tries to use any of that space, the OS will actually be alerted, at which point it can do a lot of magical things, such as:

– Find some free physical RAM, or failing that:
– Throw out some other app’s code* that was taking up space, or failing that:
– (Optionally) compress some other app’s data and write it to disk, thus freeing up RAM.

Once the OS figures out what RAM to actually give you, it wipes the RAM for privacy reasons, maps into your address space, and returns control to your app. The memory operation is then allowed to proceed as if the RAM had been there all along.

TL;DR: virtual memory is primarily required to protect the system from apps that make mistakes or are malicious, but can also be used to let multiple apps each think that they have more memory than they really do, which is convenient for programmers.

* This is fine because the code is already on disk somewhere, so we can load it back if later needed