why do we need all this RAM again?

Page 3 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.

repoman0

Diamond Member
Jun 17, 2010
4,698
3,712
136
In addition, RAM suffers from fragmentation just like your hard drive and leads to slower performance when you're using almost all your physical memory and there's less contiguous space. We're only talking nanoseconds, but add up a bunch of nanoseconds and now you're looking at miliseconds and your RAM latency is starting to look like hard drive latency. Not good.

It's called random access memory for a reason, and that is fragmentation doesn't matter. Also there are a million nanoseconds in one millisecond.. the only reason performance would go down as memory starts to get full is the OS starts to hit the pagefile.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It's called random access memory for a reason, and that is fragmentation doesn't matter. Also there are a million nanoseconds in one millisecond.. the only reason performance would go down as memory starts to get full is the OS starts to hit the pagefile.

Memory fragmentation does indeed cause a performance decreases because the OS has to spend more time tracking and find pages. It doesn't just stupidly grab the next consecutive free page. http://linux-mm.org/PageAllocation
 

tweakboy

Diamond Member
Jan 3, 2010
9,517
2
81
www.hammiestudios.com
There is no slow down IMO after using lots of RAM, Its when it goes to the pagefile where the hd works and slows down and bottlenecks your machine. Your page file should be disabled by the way if you have 6GB RAM or more. gl
 
Feb 19, 2001
20,155
23
81
whats with people saying 4gb is all you need. i regularly game and surf the web. as i alt tab out, i can see that plenty of RAM is being used. I'd say 6gb is the bare minimum. I went 6gb, but I can see how 4gb gets eaten up fast. My other system I just built has 8gb. I'd say 8gb is a safe amount.

If I have photoshop and games and web stuff open with Lightroom, I can get to 5ish GB, making 6gb not so safe. 8gb is a bare minimum, but if you're doing X58 builds, you will need 12gb to take advantage of the triple channel.

Bottom line is I recommend 12gb of 16gb for builds because even 16gb only costs $150.

There is no slow down IMO after using lots of RAM, Its when it goes to the pagefile where the hd works and slows down and bottlenecks your machine. Your page file should be disabled by the way if you have 6GB RAM or more. gl

no need. windows manages page files properly so that it's only used when needed.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I stand corrected. how much of a performance decrease is there though really?

Small, probably unnoticeable except in very specific circumstances. I remember there being discussion on lkml about the performance of the SLAB allocator and I think a new one called SLUB was being worked on which was simpler and faster. But that's a detail that most people wouldn't ever have to know about and I'm sure the performance differences were only visible in benchmarks.

tweakboy said:
There is no slow down IMO after using lots of RAM, Its when it goes to the pagefile where the hd works and slows down and bottlenecks your machine. Your page file should be disabled by the way if you have 6GB RAM or more. gl

Paging to/from disk regardless of the location slows down your machine but the MM isn't magic, it has to do some bit of work, so in certain circumstances performance can suffer.

And you should never disable your pagefile regardless of how much memory you have.
 

kmmatney

Diamond Member
Jun 19, 2000
4,363
1
81
I've been fine gaming with 2GB of DDR2. I don't think its worth it for me to go higher, until I jump to DDR3.
 

code65536

Golden Member
Mar 7, 2006
1,006
0
76
whats with people saying 4gb is all you need. i regularly game and surf the web. as i alt tab out, i can see that plenty of RAM is being used. I'd say 6gb is the bare minimum. I went 6gb, but I can see how 4gb gets eaten up fast. My other system I just built has 8gb. I'd say 8gb is a safe amount.
Well, it depends on what you mean by "used".

I noticed, after going from 4GB to 16GB, that my commit charge was significantly higher: it now easily exceeds 4GB when I used to rarely hit 4GB. Furthermore, the sum of the private bytes of all my my processes was much lower than my commit. This puzzled me because I have SuperFetch disabled (it is disabled by default if you have a SSD), and the RAM used by the NT file system cache does not show up in the commit figures. So I ran RAMMap to see exactly what was using up that RAM.

It turns out that when Windows maps a file into memory (which is what it does when it loads a DLL, for example; some programs also access files by mapping them into memory), that file remains resident in memory even after the process that was using that file had long exited. The RAM used by these mapped files are marked as "standby", which means that when there is memory pressure, the OS will jettison them and reclaim that RAM. These mapped files were counting towards my commit, but with a lot of RAM, there was never any memory pressure and these standby pages were never reclaimed. I still have files loaded in memory from a game that I had last ran days ago. And it's all counting towards my memory usage, even if the pages are dormant and on the standby chopping block.

Moral of the story: be careful of the commit figure, especially if you have a lot of RAM on your system.

Moral #2 of the story: Excess RAM is still useful; in my case, if I were to have run that game again, it would have started up really quickly because all of its data files were still mapped in RAM. And there is the file system cache that could make good use of extra RAM. Finally, there's Superfetch, for people with that enabled.

windows manages page files properly so that it's only used when needed.
Almost.

I monitor my pagefile usage, and ever since I upgraded my RAM above 4GB, the pagefile usage has always remained at 0 bytes (so it's there, but Windows is not using it, which is to be expected). Except when I put the system into hybrid sleep (for desktop systems, hybrid sleep is the default). For some reason, Windows will page things out if you enter hybrid sleep. It makes no sense since there's no paging out for sleep or for hibernation. But if you use hybrid sleep, it will page out a good chunk of your memory (which really kinda defeats the purpose of hybrid sleep; I wonder if it's even intentional or if it's a bug).

So unless you have hybrid sleep enabled, there's really no point in disabling the pagefile (aside from reclaiming disk space) since Windows will not use it unless it's actually necessary. I do keep a 1GB pagefile because the pagefile is where the kernel coredumps in the event of a BSOD (in the event of a BSOD, there is a good chance that the file system driver may be compromised or unavailable, so the kernel needs a "safe" area where it can blindly write stuff, and the pagefile is that area; with the pagefile disabled, the kernel cannot dump if it crashes).
 
Last edited:

Makaveli

Diamond Member
Feb 8, 2002
4,800
1,264
136
Well, it depends on what you mean by "used".

I noticed, after going from 4GB to 16GB, that my commit charge was significantly higher: it now easily exceeds 4GB when I used to rarely hit 4GB. Furthermore, the sum of the private bytes of all my my processes was much lower than my commit. This puzzled me because I have SuperFetch disabled (it is disabled by default if you have a SSD), and the RAM used by the NT file system cache does not show up in the commit figures. So I ran RAMMap to see exactly what was using up that RAM.

It turns out that when Windows maps a file into memory (which is what it does when it loads a DLL, for example; some programs also access files by mapping them into memory), that file remains resident in memory even after the process that was using that file had long exited. The RAM used by these mapped files are marked as "standby", which means that when there is memory pressure, the OS will jettison them and reclaim that RAM. These mapped files were counting towards my commit, but with a lot of RAM, there was never any memory pressure and these standby pages were never reclaimed. I still have files loaded in memory from a game that I had last ran days ago. And it's all counting towards my memory usage, even if the pages are dormant and on the standby chopping block.

Moral of the story: be careful of the commit figure, especially if you have a lot of RAM on your system.

Moral #2 of the story: Excess RAM is still useful; in my case, if I were to have run that game again, it would have started up really quickly because all of its data files were still mapped in RAM. And there is the file system cache that could make good use of extra RAM. Finally, there's Superfetch, for people with that enabled.


Almost.

I monitor my pagefile usage, and ever since I upgraded my RAM above 4GB, the pagefile usage has always remained at 0 bytes (so it's there, but Windows is not using it, which is to be expected). Except when I put the system into hybrid sleep (for desktop systems, hybrid sleep is the default). For some reason, Windows will page things out if you enter hybrid sleep. It makes no sense since there's no paging out for sleep or for hibernation. But if you use hybrid sleep, it will page out a good chunk of your memory (which really kinda defeats the purpose of hybrid sleep; I wonder if it's even intentional or if it's a bug).

So unless you have hybrid sleep enabled, there's really no point in disabling the pagefile (aside from reclaiming disk space) since Windows will not use it unless it's actually necessary. I do keep a 1GB pagefile because the pagefile is where the kernel coredumps in the event of a BSOD (in the event of a BSOD, there is a good chance that the file system driver may be compromised or unavailable, so the kernel needs a "safe" area where it can blindly write stuff, and the pagefile is that area; with the pagefile disabled, the kernel cannot dump if it crashes).

Great Post!
 

Jeff7181

Lifer
Aug 21, 2002
18,368
11
81
I stand corrected. how much of a performance decrease is there though really?

ArsTechnica did a good writeup a while back that indirectly explains how memory fragmentation can affect performance.

It's quite a long writeup, but this is the pertinent section.

http://arstechnica.com/paedia/r/ram_guide/ram_guide.part2-4.html#Activate

In summary, the more often it has to change banks and rows to read the data it wants, the greater the performance hit. And why would it have to change banks and rows often? For the same reason a fragmented hard disk has to seek all over the physical disk, different tracks, different sectors to read one fragmented file. And yes, we're talking nanoseconds here, but percentages are more telling... if a large portion of the reads from memory are of fragmented data you might have a few hundred thousand read operations taking twice as long as they would if you had gobs of free memory that it could have written the data to in one contiguous blob.
 
Last edited:

poohbear

Platinum Member
Mar 11, 2003
2,284
5
81
With the price of RAM now do it. I remember when DDR2 RAM was dirt cheap but i never made the move from 2gb to 4gb, then when prices skyrocketed and 4gb was becoming the norm, i paid triple the price i could've paid. This scenerio WILL happen with DDR3 one day, so get it now while its cheap.

For me, Unreal Tournament III uses 477,172K I may be wrong but that is no where near 12Gb

lol why are you even in this thread?
 

jimhsu

Senior member
Mar 22, 2009
705
0
76
Right now, doing absolutely nothing:

Total memory: 8172MB
In Use: 4142MB
Modified: 68MB
Standby: 3223MB
Free: 732MB

Superfetch is enabled.

From what I can see, the biggest users right now are Firefox and the Crashplan client (online backup) at 1/2 a gig each. Other "windows stuff" adds up to 1.5GB.

Important point: just because you have 2GB of usage on a 4GB system, does not mean that you will have the same usage on a 8GB system, with the exact set of apps open. This is due to the caching issue/"benefit" mentioned by an earlier poster on this thread.
 

GammaLaser

Member
May 31, 2011
173
0
0
ArsTechnica did a good writeup a while back that indirectly explains how memory fragmentation can affect performance.

It's quite a long writeup, but this is the pertinent section.

http://arstechnica.com/paedia/r/ram_guide/ram_guide.part2-4.html#Activate

In summary, the more often it has to change banks and rows to read the data it wants, the greater the performance hit. And why would it have to change banks and rows often? For the same reason a fragmented hard disk has to seek all over the physical disk, different tracks, different sectors to read one fragmented file. And yes, we're talking nanoseconds here, but percentages are more telling... if a large portion of the reads from memory are of fragmented data you might have a few hundred thousand read operations taking twice as long as they would if you had gobs of free memory that it could have written the data to in one contiguous blob.

Where does it show how the % of used memory have an effect on the memory access latency, assuming the page is found in RAM? It's up to the memory controller to properly interleave data in the DRAM array so that cache misses stride across different banks, preventing rows from being prematurely closed. You must then depend on spatial locality of the applications to maximize useful data per row access. Yes, latency will go way up if a hard page fault happens but that has a different cause.
 

poohbear

Platinum Member
Mar 11, 2003
2,284
5
81
Right now, doing absolutely nothing:

Total memory: 8172MB
In Use: 4142MB
Modified: 68MB
Standby: 3223MB
Free: 732MB

Superfetch is enabled.

From what I can see, the biggest users right now are Firefox and the Crashplan client (online backup) at 1/2 a gig each. Other "windows stuff" adds up to 1.5GB.

Important point: just because you have 2GB of usage on a 4GB system, does not mean that you will have the same usage on a 8GB system, with the exact set of apps open. This is due to the caching issue/"benefit" mentioned by an earlier poster on this thread.

dude, Win7 doesnt NEED that RAM, its using it because its available and cramming programs into it. Even if you add 16GB of RAM it'd probably use more, it sure as hell doesnt mean your system is "benefiting" from 16GB over 8GB. Its just the way Win7 is programmed, its not proof your system benefits from 8gb over 4gb, or 16gb over 8gb.
 

nanaki333

Diamond Member
Sep 14, 2002
3,772
13
81
dude, Win7 doesnt NEED that RAM, its using it because its available and cramming programs into it. Even if you add 16GB of RAM it'd probably use more, it sure as hell doesnt mean your system is "benefiting" from 16GB over 8GB. Its just the way Win7 is programmed, its not proof your system benefits from 8gb over 4gb, or 16gb over 8gb.

yep. it's just caching things it thinks you're going to open or want to open. it's why even computers with a 5400rpm HDD, but have 16GB of memory, the machine seems really snappy.
 

Carfax83

Diamond Member
Nov 1, 2010
6,841
1,536
136
Do you guys know any good memory tweaks? I've tried most of them, but the only one that works is the one that enables large cache ie disables pagefile.

All the others seem to have little or zero impact.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Do you guys know any good memory tweaks? I've tried most of them, but the only one that works is the one that enables large cache ie disables pagefile.

All the others seem to have little or zero impact.

And they shouldn't have any impact on day to day performance, Vista and up manage your memory just fine out of the box.
 

Makaveli

Diamond Member
Feb 8, 2002
4,800
1,264
136
This ^^^

And why do you need memory tweaks with 12GB's of ram in your system unless your workload is pushing memory use over this amount and at this which point you would need to go up to 24gb.
 

wirednuts

Diamond Member
Jan 26, 2007
7,121
4
0
i think for most people with win7 boxes-

2gb is fine if youre not gaming.

4gb is good for gaming but some games will benefit from 6gb or more.

8gb is futureproof until the next gen cpu's and ram chips come out.

i used 4gb for a long time, but just last week i slapped in another 2gb stick and my top end games do load a lot faster. you can tell 4gb was pretty good but in some situations its not optimal. i would agree for latest games, 6gb is what you need for full performance.
 

Carfax83

Diamond Member
Nov 1, 2010
6,841
1,536
136
I meant memory tweaks to make Windows 7 use more memory, not less..

One of the biggest differences between Vista and Windows 7 is that the former uses very aggressive prefetching compared to the latter. Vista would use practically all of your memory for cache, which is both good and bad I suppose. Vista prefetches everything, even the stuff you rarely ever clicked on, while Windows 7 only seems to prefetch the programs/apps you use regularly..
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I meant memory tweaks to make Windows 7 use more memory, not less..

One of the biggest differences between Vista and Windows 7 is that the former uses very aggressive prefetching compared to the latter. Vista would use practically all of your memory for cache, which is both good and bad I suppose. Vista prefetches everything, even the stuff you rarely ever clicked on, while Windows 7 only seems to prefetch the programs/apps you use regularly..

And that's probably why so many people bitch about Vista's performance, Win7 does it better so why go back to the old, bad way?
 

Carfax83

Diamond Member
Nov 1, 2010
6,841
1,536
136
And that's probably why so many people bitch about Vista's performance, Win7 does it better so why go back to the old, bad way?

You're right of course. But I just liked the sight of seeing all of my memory being used.....even if it's mostly for frivolous things :D
 

techie81

Senior member
Feb 11, 2008
327
0
76
Windows 7 will use all your RAM effectively. Going from 4GB to 8GB showed a difference, although subtle. If you are just running 4Gb and you want to run something like a Virtual OS, bam, you are going to be low on RAM. Now days you can get 8GB for $60 so there really is no reason not to have more RAM.