Slashdot Mirror


Ars Analysis Calls Windows 7 Memory Usage Claims "Scaremongering"

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."

29 of 334 comments (clear)

  1. So by sopssa · · Score: 5, Informative

    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.

    1. Re:So by Der+PC · · Score: 3, Informative

      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 :-|

      --
      This signature is DRM protected. By the DMCA, you are not allowed to counteract or oppose to it.
    2. Re:So by ls671 · · Score: 4, Informative

      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

      --
      Everything I write is lies, read between the lines.
    3. Re:So by Dutch+Gun · · Score: 5, Insightful

      More to the point, the company that wrote this little monitoring tool badly misunderstood basic principles of how the operating system works. At this point, I think we can move on and completely disregard any conclusion they came to. It either demonstrated profound ignorance or a deliberate attempt to mislead people it what turned out to be a slashvertisement of their products and company.

      From the article:

      One might almost think that this whole exercise was simply a cynical ploy. Allegations of Microsoft bloatware are, of course, nothing new, and oblique references to the old canard that what Intel gives, Microsoft takes away does nothing to dispel the impression that this is another case of Microsoft bashing.

      What a surprise. Fortunately, people really didn't even let them get away with it even in the previous article. Microsoft deserves plenty of what slashdot slings its way, but let's stick try sticking to facts.

      --
      Irony: Agile development has too much intertia to be abandoned now.
    4. Re:So by Blakey+Rat · · Score: 4, Insightful

      The vast, vast, vast, vast majority of that cached memory is read-only caches (like DLL caching and superfetch) which doesn't need to be "dumped". Some small, very small, portion of it is read/write disk cache, but that portion is never going to be dumped unless you're *completely* out of memory otherwise. And that's basically a "last resort failure mode" at that point.

      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.

    5. Re:So by mystikkman · · Score: 5, Insightful

      You have no idea what you're talking about. Superfetch is much more than stats on commonly opened files. It takes into account the times of the day, weekends etc. too among other advanced stats. Anyway if it's trivial to roll your own, why doesn't such a thing run by default in Ubuntu? That's the thing that's sad and depressing, not giving names to technology.

    6. Re:So by Rockoon · · Score: 4, Informative

      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.

      --
      "His name was James Damore."
    7. Re:So by Jah-Wren+Ryel · · Score: 5, Insightful

      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).

      The problem with previous versions of windows (I haven't used anything newer than XP) is in how the OS decides that you do not "need, use or have a purpose for" certain types of memory.

      The pathological, and yet all too common case with XP is the OS's decision that text pages should be dumped in favor of disk cache far too soon. The result being that if you have multiple apps open and a few that you haven't touched for roughly 10 minutes and then go to copy a couple of gigabytes of files around the text pages for those 'idle' applications are flushed out and the disk cache loaded with parts of those copied files (which you are unlikely to ever need). When you click on the iconbar to bring one of those formerly idle apps back to the foreground the system grinds away for a long time (obviously machine dependent but never instantly and frequently way beyond the point of annoying) as it reloads those text pages from disk before the application even starts to redraw itself much less starts becoming fully interactive again.

      The worst part about that behavior is that, to the best of my knowledge, there are no knobs to tweak it. I can't specify how long a text page needs to be idle before it should be a candidate for flushing or even if it should be pinned down permanently so that is never paged out. 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.

      --
      When information is power, privacy is freedom.
    8. Re:So by berboot · · Score: 5, Informative

      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
      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

    9. Re:So by m_pll · · Score: 4, Informative

      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 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)

      .

    10. Re:So by Foolhardy · · Score: 4, Informative

      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. You may also look into increasing the process's minimum working set with SetProcessWorkingSetSize. 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.

    11. Re:So by m_pll · · Score: 4, Informative

      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.

  2. 2GB on XP isnt enough anymore by Hadlock · · Score: 3, Interesting

    I think it's just a sign of the times. I regularly bump up against my 2GB ram limit (once a day) if I have GIMP/Photoshop open, 3 or 4 Chrome windows open with 10-20 tabs each (many of those being youtube videos), usually a videogame in the background (Windowed No Border mode at full or almost full screen resolution rules), along with whatever else I'm doing, a paused VLC video, steam, and any other background apps + whatever I'm working on currently. This isn't a problem in Win7, it's a problem of Leaving a Bunch of Shit open all the time.

    --
    moox. for a new generation.
  3. Re:It's a matter of definitions by Beelzebud · · Score: 4, Insightful

    It's not "hogging" memory if it dumps it the second you start up a program that needs it... It also doesn't make your system "appear" faster, it makes it faster. I paid for all that RAM, I don't mind it being taken advantage of; that's why it's there in the first place...

  4. Linux does that by Animats · · Score: 5, Informative

    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 ("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. The locking in this area is very complex.

  5. Re:Byte vs. megabyte by Colin+Smith · · Score: 3, Interesting

    If one byte takes 10^-9 s, a million bytes take 10^3 s.

    Only if you do them one at a time, one after another, waiting till each had been cleared. That'd be... Wait this is Microsoft we're talking about here... Carry on.

     

    --
    Deleted
  6. Re:It's a matter of definitions by Superdarion · · Score: 5, Insightful

    Windows 7 is sucking up your system memory to make Windows appear faster.

    So windows has a feature which makes everything run faster and yet it only "makes Windows appear faster", instead of making it actually faster?

    It seems to me that windows is only using hardware in a rather intelligent way: if it's not being otherwise used or needed, it uses it to boost performance.

    Linux does the same thing, as far as I know, and you don't see anybody calling Linux a memory hogging OS.

  7. Re:Byte vs. megabyte by Anpheus · · Score: 4, Funny

    Everyone knows there's a shadow-bus on the motherboard that only open source operating systems have access to.

  8. Re:It's a matter of definitions by Subliminalbits · · Score: 3, Insightful

    Describing caching as a way Windows makes your computer "appear" faster is really a little disingenuous. If that is the only metric for your complaint then you should be angry that your processor caches as well. After all, your processor takes the time to check two or three caches every time it issues a move instruction. If it misses every time, then it has to pick what to throw out of the cache and read directly from memory. Wouldn't it be so much better if it just made a fetch to ram every time there was a move instruction? After all, your processors caches only "appear" to make your processor faster right? The question that people should be asking if they want to get upset about SuperFetch is does this approach to ram use benefit the user enough to be worth the extra complexity in the operating system's memory allocator.

  9. Re:he's a native speaker by JustOK · · Score: 3, Funny

    People always mix up Sweden and Swindon

    --
    rewriting history since 2109
  10. This is one of those great mysteries of life by davmoo · · Score: 5, Insightful

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

    I've got 8GB of ram in the machine I'm on at the moment, and I want the OS and applications to use it to the fullest and most efficient extent possible at all times. I didn't install a 64-bit OS and 8GB of ram so that I can see 6GB free at all times.

    --
    I want a new quote. One that won't spill. One that don't cost too much. Or come in a pill.
    1. Re:This is one of those great mysteries of life by Overzeetop · · Score: 3, Informative

      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.

      --
      Is it just my observation, or are there way too many stupid people in the world?
    2. Re:This is one of those great mysteries of life by nine-times · · Score: 4, Funny

      But it makes me feel so awesome to see 6GB free. I'm all like, "Damn, I have a lot of RAM!" When the RAM is all fully, my system monitoring graphs don't look at cool. I also like seeing my CPU utilization showing 4 cores, each idling around 1%, and having a multiple terabytes of free space on my hard drives. All those graphs get ruined if you actually use your computer for stuff.

  11. Re:It's a matter of definitions by Suiggy · · Score: 4, Interesting

    If Windows 7 actually uses that much memory it's not scaremongering, it's memory hogging. Whether it's using it on not is a pretty fine distinction, it's still using it just because it can. If something else needs it, Windows has to decide if it wants to let go of it or not.

    So are you saying Linux, BSD, Mac OS X and pretty much every other modern desktop OS other than Windows XP are also memory hogs as well? Because they also do the exact same thing and use up all of the free memory for caching, marking it as available.

  12. Re:30ms? by ashridah · · Score: 4, Informative

    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.)

  13. that was supposition by YesIAmAScript · · Score: 4, Informative

    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

    --
    http://lkml.org/lkml/2005/8/20/95
  14. Re:Tits on a bull by mrnobo1024 · · Score: 3, Insightful

    fflush() just flushes stdio's buffer, so that any data written to the file is sent to the operating system (via write() on *nix), making it visible to other programs. It does not flush anything in the operating system's own buffers/caches. Also, fclose() calls fflush() automatically, so calling both is redundant.

    You're probably thinking of fsync(), a system call that does actually force data to disk. And should almost never be used, unless you enjoy waiting through several seconds of disk grinding and general unresponsiveness.

  15. Re:Windows 7 and Vista Lie about memory usage by m_pll · · Score: 4, Informative

    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".

  16. Re:30ms? by ashridah · · Score: 3, Insightful

    I didn't make a snide remark. I pointed out that windows maintains a pool of zeroed ram, and will constantly fill it when it's able to.

    Windows will allocate from that pool first, and then top it back up when it hits a threshold of low free memory from supercache.
    It then has the luxury of handling this in the background, so you're not waiting for the system to zero memory out, unless you somehow manage to totally max out the memory you've got in use.
    It's at this point when you've got bigger problems, like the fact that the disk will probably become your bottleneck, not the speed at which you can zero out ram.

    I didn't miss your point, I'm suggesting that you're not thinking like an operating system designer, and saying "how can i shorten the critical path of giving a process the memory it requests?" The answer is: Pre-zero memory, and fill the zeroed pool from the cache as needed when you get low. There's no "wait" for zeroed out memory, at this point.