Jump to content

Can someone answer this? Ram question

So, I know we have probably all heard the popular rhetoric (that linus often offers) about how ram is useless if you are not using it, and that slowdown will only occur if 100% of ram is being used.

 

However, I have noticed on multiple machines now that also run separate OS that slowdown occurs when about 80% of Ram is being used according to task manager, intel extreme, or the settings in my android phone. If Linus (and all the others in the forums, who may simply be echoing him) then this might be a problem for this theory. Of course, it is possible that all these memory observing utilities are in actuality wrong about how much memory is truly in use; perhaps there is some "garbage" floating around in the ram that the manager does not detect somehow.

 

Anyway, I am interested in this, so if someone was able to really answer it for me or confirm (reliably) that my hypothesis about the task manager not being very accurate is true, then it would really make me feel a lot better about this issue.

Link to comment
Share on other sites

Link to post
Share on other sites

 

Almost of uses the extra ram as a cache.

 

Depends on the os, you can normally chagne the swappyness and how aggressively it dumps stuff in swap.

 

How are you measuring slowness, it is swapping?

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Electronics Wizardy said:

 

Almost of uses the extra ram as a cache.

 

Depends on the os, you can normally chagne the swappyness and how aggressively it dumps stuff in swap.

 

How are you measuring slowness, it is swapping?

I am not quite sure what your first statement means.

The second point is quite interesting, although I am not sure how well this can be done on Android.

 

Slowness is measured just by my own perception. For instance, as I press keys, the screen displays the characters much faster than it did for my other comment because I had a few more browser tabs open, and thus was using over 80% of the RAM.

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Sam_Goody said:

am not quite sure what your first statement means.

Most os's use the extra ram as a disk cache for read and write.

 

1 minute ago, Sam_Goody said:

The second point is quite interesting, although I am not sure how well this can be done on Android.

If you have access to the disk its just a config file.

 

1 minute ago, Sam_Goody said:

Slowness is measured just by my own perception. For instance, as I press keys, the screen displays the characters much faster than it did for my other comment because I had a few more browser tabs open, and thus was using over 80% of the RAM.

How much ram do you have and is it swapping to disk? My system is fine with 19.5 out of 20gb used.

Link to comment
Share on other sites

Link to post
Share on other sites

On Android and iOS I find it's very noticeable. Best example is my iPad Mini first generation running iOS 8. Multitasking is impossible because almost always apps will run out of memory to use so background processes (even ones you've just switched out of) will be cleared and it'll have to reload the entire app again once you switch back to them. On Android, I've had applications just straight out close on me like my music player quitting as I'm browsing on Instagram even if it reports still having 100mb of RAM free.

Intel® Core™ i7-12700 | GIGABYTE B660 AORUS MASTER DDR4 | Gigabyte Radeon™ RX 6650 XT Gaming OC | 32GB Corsair Vengeance® RGB Pro SL DDR4 | Samsung 990 Pro 1TB | WD Green 1.5TB | Windows 11 Pro | NZXT H510 Flow White
Sony MDR-V250 | GNT-500 | Logitech G610 Orion Brown | Logitech G402 | Samsung C27JG5 | ASUS ProArt PA238QR
iPhone 12 Mini (iOS 17.2.1) | iPhone XR (iOS 17.2.1) | iPad Mini (iOS 9.3.5) | KZ AZ09 Pro x KZ ZSN Pro X | Sennheiser HD450bt
Intel® Core™ i7-1265U | Kioxia KBG50ZNV512G | 16GB DDR4 | Windows 11 Enterprise | HP EliteBook 650 G9
Intel® Core™ i5-8520U | WD Blue M.2 250GB | 1TB Seagate FireCuda | 16GB DDR4 | Windows 11 Home | ASUS Vivobook 15 
Intel® Core™ i7-3520M | GT 630M | 16 GB Corsair Vengeance® DDR3 |
Samsung 850 EVO 250GB | macOS Catalina | Lenovo IdeaPad P580

Link to comment
Share on other sites

Link to post
Share on other sites

System Paging. It will use hard drive space as ram. Disabling system paging should fix this. Also, I would imagine that what you described above would only occur in systems with less than 16gb of ram.

Computers r fun

Link to comment
Share on other sites

Link to post
Share on other sites

You have to look at memory usage as a whole, i.e., the entire virtual memory system and how applications use memory. Typically in a modern OS, an application will make a memory request for X amount and the OS will generally reserve X + some change. The keyword is reserve. The OS will promise to give the memory to the application when they need it, but not any sooner. To paraphrase Raymond Chen, when you use a cleaning service, they promise to send someone over on the day you want your place cleaned. The cleaning service will not set aside one person to twiddle their thumbs until that time.

 

If all of the applications have requested the maximum amount of virtual memory space available, then any application that tries to request more will get a message from the OS saying there's no more memory left. The application will likely throw an "out of memory" error even though there's technically enough free space left. And no, an OS will not screw another application over by yanking its reserved memory space so another application can use it. It would be like if you reserved a table for 10 and enough people, but not all of them, showed up to go in the place, but the place decided to let some other people have the unused seats.

 

Linux has a quirk in that it always promises to give memory to applications, even if there is none left.

 

So if your web browser is requesting say at least 300MB per tab and you have 40 tabs open, your virtual memory consumption has now reached 12GB of memory, even if only 100MB per tab is in actual use.

Edited by M.Yurizaki
Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, Electronics Wizardy said:

 

Almost of uses the extra ram as a cache.

 

Depends on the os, you can normally chagne the swappyness and how aggressively it dumps stuff in swap.

 

How are you measuring slowness, it is swapping?

That is very strange. My tablet with 4gb gets slow once there is less than 1gb left. My Android gets slow once there is less than 200mb left (out of the 1gb it has) and my PC used to get slow while I played Arkham Knight back when it had only 8gb (6.8 of it was used while I played the game.) now it has 12gb, and I have not yet experienced any slowdown on it, but the closest I came to ever using all 12gb was 10gb, so I cannot yet say much about it.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, M.Yurizaki said:

You have to look at memory usage as a whole, i.e., the entire virtual memory system and how applications use memory. Typically in a modern OS, an application will make a memory request for X amount and the OS will generally reserve X + some change. The keyword is reserve. The OS will promise to give the memory to the application when they need it, but not any sooner. To paraphrase Raymond Chen, when you use a cleaning service, they promise to send someone over on the day you want your place cleaned. The cleaning service will not set aside one person to twiddle their thumbs until that time.

 

If all of the applications have requested the maximum amount of virtual memory space available, then any application that tries to request more will get a message from the OS saying there's no more memory left. The application will likely throw an "out of memory" error even though there's technically enough free space left. And no, an OS will not screw another application over by yanking its reserved memory space so another application can use it. It would be like if you reserved a table for 10 and enough people, but not all of them, showed up to go in the place, but the place decided to let some other people have the unused seats.

 

Linux has a quirk in that it always promises to give memory to applications, even if there is none left.

 

So if your web browser is requesting say at least 300MB per tab and you have 40 tabs open, your virtual memory consumption has now reached 12GB of memory, even if only 100MB per tab is in actual use.

That is very interesting. So Linux will actually never have the problem of "out of memory" because the apps are always given as much memory as they need (well, assuming that the amount of memory they are said to maximally need is always correct.)

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, TheNuzziNuzz said:

System Paging. It will use hard drive space as ram. Disabling system paging should fix this. Also, I would imagine that what you described above would only occur in systems with less than 16gb of ram.

So your answer is, as I understand it a little different from the one M.Yurizaki gave. You believe that my OS is using disk space as RAM even though I still have 1 GB of Ram space left, which is why the slowdown occurs.

Of course, it may be the case that both of you made correct statements as a system could begin using some disk space as ram in order to make sure that no apps that would run incredibly slowly on disk space get the juice that they need, should they need it, or because all promised space is also used already.

However, I find your suggestion that the disabling of paging would help to be a bit hard to believe. If the computer decides that it needs to make up for a shortage of ram by making disk space available, then it should be allowed to do so as I will otherwise just run out of RAM, at which point serious swapping must occur.

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, BlueChinchillaEatingDorito said:

On Android and iOS I find it's very noticeable. Best example is my iPad Mini first generation running iOS 8. Multitasking is impossible because almost always apps will run out of memory to use so background processes (even ones you've just switched out of) will be cleared and it'll have to reload the entire app again once you switch back to them. On Android, I've had applications just straight out close on me like my music player quitting as I'm browsing on Instagram even if it reports still having 100mb of RAM free.

Yes, I know how it is. It is quite annoying. I once heard that Android has the worst memory management of all the mobile operating systems. I forgot the explanation of why, but I believe it was an imprecision within the garbage collection. As such, it is recommended that the Android be turned off very frequently. Of course, they now have a "smart manager" for memory, but I find that that only helps a little.

Anyway, Windows and iOS are actually cheaper phones to make for this reason as they require less RAM to function as efficiently, and if you pay attention, windows phones are actually cheaper. Apple of course still charges a lot, but apple can afford to do that as their company is a bit like a religion in that people just believe that it is 10x better than the alternatives even if the screen always breaks and the battery always runs out of juice too quickly and firmware updates destroy systems that are 2+ years old.

Link to comment
Share on other sites

Link to post
Share on other sites

12 minutes ago, Sam_Goody said:

That is very interesting. So Linux will actually never have the problem of "out of memory" because the apps are always given as much memory as they need (well, assuming that the amount of memory they are said to maximally need is always correct.)

The issue with Linux is it does something called overcommit by default. If you're familiar with C, there's a function called malloc that makes a system call to the OS to request some memory. Normally if there's not enough memory available, malloc will return a null pointer. However in Linux, malloc always returns something valid, even if there's not enough memory available. So the program will throw an out of memory error or segfault if it tries to use the memory it was supposedly given.

 

I'm not sure why though your system slows down when you have 1GB of technically free memory, unless for some reason other programs are hogging it up and not actually using it and you've already taxed your page file. If you really want to see how much virtual memory is being used, tally up the Commit Size field.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×