Forgot your password?

typodupeerror
Windows

Ars Analysis Calls Windows 7 Memory Usage Claims "Scaremongering" 334

Posted by timothy
from the nothing-but-dihydrogen-monoxide-to-drink dept.
Via newsycombinator comes a reaction at Ars Technica to the recently reported claims of excessive memory use on machines running Windows 7. From the article: "I installed the XPnet performance monitoring tool and waited for it to upload my data to see what it might be complaining about. The cause of the problem was immediately apparent. It's no secret that Windows 7, just like Windows Vista before it, includes aggressive disk caching. The SuperFetch technology causes Windows to preload certain data if the OS detects that it is used regularly, even if there is no specific need for it at any given moment. Though SuperFetch is a little less aggressive in Windows 7, it will still use a substantial amount of memory—but with an important proviso. The OS will only use memory for cache when there is no other demand for that memory."
This discussion has been archived. No new comments can be posted.

Ars Analysis Calls Windows 7 Memory Usage Claims "Scaremongering"

Comments Filter:
  • So (Score:5, Informative)

    by sopssa (1498795) * <sopssa@email.com> on Saturday February 20 2010, @04:30PM (#31212712) Journal

    Though SuperFetch is a little less aggressive in Windows 7, it will still use a substantial amount of memory—but with an important proviso. The OS will only use memory for cache when there is no other demand for that memory.

    I really wonder when people will get this. In the earlier thread I saw people commenting that Windows 95 didn't need so much memory and so on..

    To state it again. This is not RAM memory you need, use or have purpose for. IF you do need it, it is zeroed-out and free'd to application in like 30ms (one frame in usual FPS games).

    If you have fast memory, do use it to it's full extend.

  • Re:So (Score:1, Informative)

    by Anonymous Coward on Saturday February 20 2010, @04:35PM (#31212752)
    Not everyone who reads slashdot has english as their first language. It's still understandable without inducing headaches in anyone who isn't a grammar nazi, it's fine.
  • 30ms? (Score:3, Informative)

    by Colin Smith (2679) on Saturday February 20 2010, @04:35PM (#31212754)

    Really? 30ms. Shit that's slow.

    This IS RAM we're talking about here, right? y'know nanosecond stuff, 10^-9 not 10^-3 seconds.

  • Re:So (Score:3, Informative)

    by Der PC (1026194) on Saturday February 20 2010, @04:37PM (#31212776)
    You must be an anonymous moron making such a claim.

    #1) Linux _doesn't_ have all the best and greatest technology built in.
    #2) It even does have some really crappy technology in between.
    #3) guess what the "-/+ buffers/cache" line in the output of "free" means
    #4) guess what the "buffers" and "cached" columns of "free" means
    #5) guess what prefetch/preload is.

    Sheez... anyone gets access to a keyboard these days :-|
  • Re:So (Score:2, Informative)

    by Amnenth (698898) on Saturday February 20 2010, @04:37PM (#31212778)

    People aren't taking the time to learn the meaning of the 'available' memory stat in the Task Manager.

    Based on my experience, it's usually very close to the total you get when adding 'free' memory and 'cached' memory together.

    'Available' in this case means that, as parent suggests, Windows will free it for use as soon as it's needed.

  • by Runefox (905204) on Saturday February 20 2010, @04:47PM (#31212882) Homepage

    As I understand it, it doesn't cache data, it caches applications (and I think also fonts and other often-used things). So startup time for your web browser, e-mail client, IM client, and any other applications you use often will be much faster. For example, Google Chrome loads almost instantaneously on my system, from a cold start. It won't keep a memory cache of things that applications do, and hence it won't speed up compilation, rendering, etc.

    For that matter, 2GB of RAM isn't a whole lot to cache with when you think about it. The sweet spot for Vista/Win7 is really around 4GB or higher for SuperFetch to really shine.

  • by sopssa (1498795) * <sopssa@email.com> on Saturday February 20 2010, @04:48PM (#31212888) Journal

    This is completely offtopic, but you seem to come with this message in every thread so I answer you one time here - I am from sweden, not uk.

  • by mschuyler (197441) on Saturday February 20 2010, @04:53PM (#31212928) Homepage Journal

    Seems to use 1.3 gig no matter what I do. It's got 4 gig total. Boots in less than 2 minutes. It makes mistakes a lot faster than the old machine, which was just shy of a brick when I switched.

  • Re:So (Score:5, Informative)

    by ls671 (1122017) * on Saturday February 20 2010, @04:53PM (#31212938) Homepage

    Yep, same for Linux. My Linux boxes use ALL the memory available even if I do not run many applications on it. The left over memory SHOULD be used as buffers/cache. If Windows 7 seems to use more memory from a newbie point of view, it might be because it does things like it should better than previous versions. I can't tell for sure since I have never tried win 7.

    See this 4 GB Linux machine below, it only has ~49 MB of "absolutely free" memory and uses ~449 MB of swap.

    In realty, it has ~2842 MB of "available memory" since it uses ~2792 MB of buffer/cache.

    Using buffer/cache makes the system order of magnitude faster. If programs need that memory, the OS will give to them and use less buffer/cache.

    free
                              total used free shared buffers cached
    Mem: 4133252 4083380 49872 0 26852 2766248
    -/+ buffers/cache: 1290280 2842972
    Swap: 1999800 449244 1550556

  • Re:30ms? (Score:0, Informative)

    by Anonymous Coward on Saturday February 20 2010, @04:54PM (#31212944)

    Furthermore, RAM is not used when it is allocated. When app allocated memory, it only allocates address space. You could easily have 2:1 or 5:1 ratio of allocated memory space to used RAM. RAM is only used when application starts to use that memory.

    In addition, there is READ-ONLY memory (non-writable, executable) that is shared between applications.

    This is another reason why having more than 2G of RAM on a 32-bit OS is dumb. OS runs out of address space and your 4G ram can easily be cut down to 2G usable. For heavy multi-tasking applications, where you have lots of specialized hardware (ie. graphic cards, DMA accessible RAID, etc) I wouldn't be surprised if a 32-bit OS would have problems managing more than 2G ram.

  • by zach_the_lizard (1317619) on Saturday February 20 2010, @04:55PM (#31212956)
    And though your English has some minor mistakes every now and then, it's not like you are writing in such a way that we cannot understand you. Your English is better than my grasp of Spanish by many miles. Congrats.
  • Re:30ms? (Score:2, Informative)

    by Alwin Henseler (640539) on Saturday February 20 2010, @04:56PM (#31212966) Homepage

    This IS RAM we're talking about here, right? y'know nanosecond stuff, 10^-9 not 10^-3 seconds.

    Yes, and nanoseconds (10^-9) multiplied by the number of memory locations to clear (10^6 when you're talking multi-MB chunks of memory) gets us right back in the millisecond (10^-3) range. Which is just a blink of the eye for us humans, btw.

  • Linux does that (Score:5, Informative)

    by Animats (122034) on Saturday February 20 2010, @04:59PM (#31212994) Homepage

    Linux uses available memory for cache, and rather aggressively. All available memory can be filled with cached file blocks. This happens routinely on systems which have big randomly-accessed files open, like databases.

    There's nothing wrong with this, except that, once in a while, Linux hits a race condition in prune_one_dentry, causing an "oops" crash, when there's an unblockable need for a memory page and something is locking the file block cache.

    This is one of the Great Unsolved Mysteries of Linux. Linus wrote about it in 2001 [indiana.edu] ("I'll try to think about it some more, but I'd love to have more reports to go on to try to find a pattern.. "). As of 2009, this area is still giving trouble. [google.com] The locking in this area is very complex. [lwn.net]

  • by ls671 (1122017) * on Saturday February 20 2010, @05:11PM (#31213096) Homepage

    Programs and compilers have nothing to do with disk read/write caches, this is handled at the OS level.

    Programs ask to read/write from/to disk and they have no idea where the OS get the data from.

    You and the GP might be confusing CPU cache that has its own dedicated memory and disk cache that uses the OS RAM.

  • Re:Tits on a bull (Score:2, Informative)

    by RobbieCrash (834439) on Saturday February 20 2010, @05:34PM (#31213288)
    That makes no sense. Superfetch is run at the lowest priority, all other reads/writes interrupt anything it's doing and it only uses idle processor time.

    At boot, Windows is doing other things not prefetching. Turn superfetch on and monitor your active processes at boot, you'll see that the superfetch PID is sittng all the way at the bottom of everything. Its IO is negligible as is its CPU usage until AFTER everything else has loaded and your system has gone back to twiddling its bits for a few hundred thousand processor cycles.

  • Re:30ms? (Score:5, Informative)

    by ashridah (72567) on Saturday February 20 2010, @05:34PM (#31213294)

    You might want to grab a copy of Process Explorer sometime, and look at the stats it reports. you'll notice that windows actually spends idle time pre-zeroing ram, so that this is already done, in more than enough amounts. If your system is slammed, i could see having to pre-zero the pages, just before use, however, but it's not like it's not something that couldn't be done while waiting for other I/O operations to complete (since your system is slammed anyway :) )

    My laptop currently has 2.8 million pages zeroed atm (it has 8gb, and I don't have much running right now, so there's not a lot to cache.)

  • that was supposition (Score:5, Informative)

    by YesIAmAScript (886271) on Saturday February 20 2010, @05:35PM (#31213298)

    The only data in the article you refer to was captured data from XPnet that said that >90% of RAM was in use in Windows 7 machines. There was no data saying it led to swapping, that was supposition.

    http://www.computerworld.com/s/article/9158258/Most_Windows_7_PCs_max_out_memory [computerworld.com]

  • by Overzeetop (214511) on Saturday February 20 2010, @05:35PM (#31213300) Journal

    if everyone is so afraid of their computer memory being used to the fullest, why do these people install so much of it?

    Most users remember back to at least the 90s. You had to install enough ram to do what you needed (load the OS and program(s) - WinNT had the audacity to require 8MB to run well). There was no caching of any useful sort, so your free memory was really a measure of how many programs you could load. Programs, like Photoshop, added scratch files to overcome the physical RAM limits, but at a horrible performance penalty should have to actually use it. "Free RAM" became synonymous with "how many things you could do or open simultaneously."

    All modern operating systems have moved on, but people haven't been educated about this. They remember how bad it was when they ran out of memory, and panic when the OS reports it's almost full. Honestly, it would be far better if MS would have reported the cached memory differently. I don't really care how much memory is used as superfetch cache most of the time - I'm more concerned with the total active usage. My netbook "only" has 2GB, but I do some 24/96 audio recording with it, and will occasionally work with photoshop images, so I am concerned if I have less than 500-600MB free when I open a session as I'm likely to exceed the physical RAM. I can read the data, so it's not a big deal, but others freak out about it.

  • Re:30ms? (Score:1, Informative)

    by Anonymous Coward on Saturday February 20 2010, @05:36PM (#31213316)
    I guess you're never heard of PAE?
  • Re:So (Score:5, Informative)

    by Rockoon (1252108) on Saturday February 20 2010, @05:45PM (#31213390)

    You're as bad as the guys who wrote that article in the first place. If you don't know how Windows works, please don't talk about it.

    Hell, its not just windows. All operating systems do this.. and to be quite frank, programmers of all kinds should have cache techniques well understood. So the GP is neither a windows guru nor a decent programmer. The odds are very good that hes just an I-use-software geek, rather than someone who knows anything about computers.

  • Re:So (Score:5, Informative)

    by berboot (838932) on Saturday February 20 2010, @06:09PM (#31213592)
    SuperFetch also keeps track of what times of day that applications are used, which allows it to intelligently pre-load information that is expected to be used in the near future.
    Source: Wikipedia [wikipedia.org]
    Their work, says Horvitz, was able to predict which applications users would open by time of day and also by day of the week.
    Source: InfoWeek [informationweek.com]
  • Re:So (Score:5, Informative)

    by m_pll (527654) on Saturday February 20 2010, @06:55PM (#31213896)

    So,pray tell, where do I learn the meanings of the various stats in Task Manager?

    You can press F1 while in task manager and then search for a particular metric, e.g. "available memory". This produces results that seem moderately useful, for example:

    Under Physical Memory (MB), Total is the amount of RAM installed on your computer, listed in megabytes (MB). Cached refers to the amount of physical memory used recently for system resources. Available is the amount of memory that's immediately available for use by processes, drivers, or the operating system. Free is the amount of memory that is currently unused or doesn't contain useful information (unlike cached files, which do contain useful information).

    For more details about particular counters you can check the Windows Internals book, or Memory Performance Information [microsoft.com] on MSDN. Also, many counters in task manager have similar or identical perfmon counters, and perfmon has its own help (IIRC there's a "show description" option in the counter selection dialog)

    .

  • by m_pll (527654) on Saturday February 20 2010, @07:39PM (#31214168)

    Back in the day of Windows 2000 and XP, the Task Manager chart reported the memory comit charge. Basically, that was the amount of memory applications (and Windows) requested allocated. This does not mean that much memory was actually used, but with the exception of very badly written/buggy programs, it should be close

    Not necessarily. Many programs commit large chunks of memory in case they need it later but only use a small portion initially. This simplifies program logic because you don't have to free and reallocate the buffer when you need more space, deal with potential reallocation failures etc. Or a program might want to specify a larger-than-default stack commit size to make sure it doesn't hit a stack overflow if it tries to extend the stack while the system is temporarily out of commit (most services and other system critical processes do that). Or it might map a copy-on-write view of a file, in which case commit is charged for the entire view but no extra physical memory is used until the program actually writes to the pages. Etc etc... The end result of this is that you can't really say anything conclusive about physical memory usage by looking at commit charge

    Commit charge is a virtual memory metric. It's great for detecting memory leaks and deciding how big your pagefile needs to be, but not so great for understanding physical memory usage. Often it might seem like there is a correlation between commit charge and physical memory, but you can also find systems that are very low on available RAM yet have plenty of available commit, and vice versa.

    Task manager now shows used physical memory (defined as Total - Available). Available memory is the most straightforward way to understand whether your system needs more memory or not, and this is why in Vista/Win7 it was chosen as the main indicator of "memory usage".

  • by Low Ranked Craig (1327799) on Saturday February 20 2010, @07:57PM (#31214336)
    All good operating systems do this. My Mac, for instance has "inactive memory", which is not exactly the same as Windows, but close enough. If your memory is free, it's not doing anything for you. End of story.
  • Ars (Score:2, Informative)

    by FartKnockerz (1750222) on Saturday February 20 2010, @08:32PM (#31214616)

    While catering to the Apple fan-base a little too much for my tastes -- hits it right on.

    It is scaremongering.

    .

    Cache is there for a reason -- idle RAM is useless RAM. Now, do I think that Windows allocation mechanism for idle RAM is right on? Of course not. It could use some tuning. It could have used some tuning since XP -- but is idle RAM stupid? Yes.

    Anything that can update the pipeline between process/thread interaction with data before it has to go to disk -- is preferred.

    However, Windows needs to be smart about what it caches and keeps in the pre-fetch. Frequently used and accessed rather than conditional stale.

    That's the point.

  • Re:So (Score:5, Informative)

    by Foolhardy (664051) <csmith32 AT gmail DOT com> on Saturday February 20 2010, @10:21PM (#31215360)

    I once went looking to see if there was a way to do it from within the application code itself - something like mlock()/mlockall() in posix - and I couldn't find an equivalent, which may just be a reflection of my own inexperience with the Windows API but I figured I would throw that out there anyway.

    The function you're looking for is VirtualLock [microsoft.com]. You may also look into increasing the process's minimum working set with SetProcessWorkingSetSize [microsoft.com]. This requires SeIncreaseBasePriorityPrivilege.

    A process that is scanning through a file is supposed to use the FILE_FLAG_SEQUENTIAL_SCAN hint so that the cached pages are recycled first, but that doesn't always happen. It also doesn't help that csrss will ask the kernel to minimize a process's working set when its main window is minimized.

  • Re:Tits on a bull (Score:3, Informative)

    by Eskarel (565631) on Saturday February 20 2010, @10:37PM (#31215442)

    Sort of.

    The issue with ext4 had to do with dirty cache not being written to disk in a timely manner. This meant that you could have disk writes you thought had already happened and certain actions could get out of sync because of they way they'd been written.

    The cache in this case is not dirty(in fact it's read only) so there's no risk of losing data (since most of the time the data on the disk and the data in memory are identical and when they're not the disk is right).

  • Re:So (Score:5, Informative)

    by m_pll (527654) on Saturday February 20 2010, @11:41PM (#31215752)

    Starting with Vista, working sets of GUI processes are no longer emptied when the main window is minimized.

    For the standby cache recycle problem, Superfetch can help a lot. First of all, it can detect when apps do things like read lots of files sequentially without using FILE_FLAG_SEQUENTIAL_SCAN (or when they do this through a mapped view) and deprioritize these pages so they don't affect normal standby memory. And if useful pages still end up being recycled (e.g. because some app temporarily consumed lots of memory), Superfetch can re-populate them from disk later.

  • Re:PAE? (Score:1, Informative)

    by Anonymous Coward on Sunday February 21 2010, @01:05AM (#31216234)

    Except PAE is supported on all Pentium Pro and later Intel CPUs.

    I don't know where you get the idiotic idea that it only works on 64-bit hardware.

  • by amliebsch (724858) on Sunday February 21 2010, @03:32AM (#31216852) Journal

    Except it simply doesn't do that as you can easily demonstrate with test case programs. Memory used for cache is used but not reserved, so if a program needs it, it will simply free some of the cache and give it to the program. No swapping required. Swapping programs in order to maintain the cache would be idiotic, but Windows doesn't do this.

A man's house is his castle. -- Sir Edward Coke

Working...