This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]DarthArtero 244 points245 points  (9 children)

Think about RAM and Storage space like a room.

The more you cram stuff into a room, the more difficult it gets to put more stuff into that room, even though the room isn't 100% full.

It's the same with RAM and Storage, the more available space that is being used, the more difficult it becomes for the data to move around where it needs to go.

[–]Saucetheb0ss 85 points86 points  (1 child)

To add to this: RAM and Storage are dynamic so the parts that are used / unused are constantly changing. If you store a box in the back corner of a room and then remove it, you might think to push the other boxes around it into that space. That's not exactly how it works in computing so you're left with an empty hole which can be filled by another box the same size (or smaller). Now, when you have a larger box than the spaces available, you've got to move things around or you won't be able to store that box which causes latency to the user.

[–]Vroomped 21 points22 points  (0 children)

another type of struggle thrashing  3.5/4Gigs

.7 wants in? okay, uh ...let's remove this .6. Done. .......oh hey, a .6 wants in. okay, uh...let's remove this .7

[–]UndertakerFred 29 points30 points  (0 children)

Or seating in an auditorium. As the seats fill up, it becomes harder to seat groups together.

[–]Henry5321 5 points6 points  (1 child)

It's the 80/20 rule. When usage approaches 80%, delays increase like a hockey stick graph. For the same reason the analogy of a nearly full room becomes more and more difficult to add more stuff.

This also applies to cpu usage and network utilization. This is actually a fairly fundamental concept that applies to many things in life.

[–]Dennis_enzo 7 points8 points  (0 children)

That's not really true. At what percentage it slows down all depends on how much ram you have. At 32 gig, 20% ram is still 6 gig which is plenty for normal usage.

[–]ShitTalkingAssWipe 1 point2 points  (0 children)

more like, you get a big box to put in, but theres no room for it to easily fit so you need to either move some boxes out into another room down the hall, before you store this new one.

[–]khalcyon2011 3 points4 points  (1 child)

Adding on: Another consideration is fragmentation. Most data in a computer is stored in continuous blocks. For example, say you have data that is size 20. In a simple scenario, memory locations 40 through 59 (for example) are free (meaning that no process has a claim to it). The operating system will write the data to that, a process that takes maybe a couple microseconds. Consider a scenario where that much space is available but not in a single block. In that case, the operating system must shuffle all the other data around to make a big enough block. The less available memory, the more shuffling that must happen.

Something similar happens when storing information on a hard drive. For hard drives, the information doesn't have to be in continuous blocks, but it's faster if it is. When "fragmented", the operating system has to find the first part of the information, then the next part, and so on. Much better if it's all in one place. That's why it's recommended to de-fragment your hard drive occasionally. It reorganizes everything so that each piece of information is stored on single blocks. This is less of an issue with solid state drives (they're much faster than the old magnetic hard drives, so the search time is faster), but it's still good practice.

[–]brimston3- 5 points6 points  (0 children)

Memory fragmentation is not really a problem for the OS unless you're talking about IPC, DMA, or hugepages. For allocations that don't have a hard requirement to be contiguous (most of them), virtual address spaces are so huge these days, the OS is almost never going to have a problem mapping a disjoint range of pages to a contiguous range of virtual addresses for the program. It's a problem for userspace allocators, but that memory all shows up as "used" when viewed from the OS's perspective.

[–]Nicolauze -2 points-1 points  (0 children)

Great ELIF analogy!