Windows 8 To Reduce Memory Footprint
bheer writes "Microsoft's Windows 8 blog has a good post about the work being done to reduce Windows 8's memory footprint. The OS will use multiple approaches to do this, including combining RAM pages, re-architecting old bits of code and adding new APIs for more granular memory management. Interestingly, it will also let services start on a trigger and stop when needed instead of running all the time."
...especially the bit about the services.
My first self-owned computer was a Kaypro 4-84. The OS was CPM and the machine came with 64K (yes, K) of RAM. When it booted up the screen said it had 63K of RAM. I thought I had been ripped off so I called the company. The tech explained that the other 1K was being used by the OS. So I don't think Windows 8 is going to impress me.
So windows is finally getting inetd?
Red to red, black to black. Switch it on, but stand well back.
My old Asus netbook recently died, so I was forced to go out and buy another. I bought an Aspire One loaded with W7S. I really wanted to like W7. Really. I liked the interface. But damn, it was really slow and memory hungry. With no pgms running, it was taking up about 560-580M of memory, compared to Ubuntu (11.04) taking 260-270M with no pgms running.
I really couldn't have more than two programs running in W7 without hitting 900M memory use. Granted, they were big pgms - Thunderbird and Firefox, both latest versions. But contrast that with Ubuntu where I ran TB, FF, Pidgin, Hotot, Tobmoy, LibreOffice and Rhythmbox all at the same time and never go above the 850M mark in memory use (at least not yet).
This release of Ubuntu has its own set of problems (Compiz, anyone?), but I much prefer it to W7. If MS can get Window's memory usage down I'd be more inclined to use the latest version.
If you actually bothered to read the blog, you'd see that these memory optimisations were one of the very first things they did and have, in fact, been in the code for about 2 years now.
+1 IDisagreeSoHeMustBeATrollOrAnAstroturferOrAShill
In a normal program in traditional desktop programming, state information in ram cannot be disposed of willy-nilly. Notably, Android took the opportunity of a new platform to declare out-of-view applications as having ram content considered disposable by default to get this benefit in 'normal' programs'. Hard for Windows to realistically do that. On the other hand, as an Android user, it is sometimes painfully obvious when an app I was 'running' in the background was killed by Android, so despite the promise of how seamless it is, it has warts depending on application implementation of saving and restoring state data.
With many services, memory resident state information is less important and you also have a smaller, better defined population to roll through. Also, if you are in the multi-window mode, you can't reasonably kill background applications, you never know when the user might be eyeballing it despite window manager focus. With a service, you know it's needed because some IO entry point got tickled.
Surprised that it took them this long to get inetd though...
XML is like violence. If it doesn't solve the problem, use more.
Longhorn (and more specifically WinFS) was one of the very few times MSFT's ever talked about features that weren't delivered. For Windows 7, I can only think of one feature which was announced that wasn't actually delivered (bluetooth audio).
Except for Longhorn features, what Windows features were promoted but not delivered?
Ye sure, this is what always happens they promise some new and better stuff, and then they drop half the stuff and the OS is just crap. I wouldn't hold my breath for any of this. It's better to wait for the actual release. This is just hype talk.
> it will also let services start on a trigger and stop when needed instead of running all the time.
Nice.
Although I have to wonder, why are "services" treated differently than other programs, in this context or any other? Does it have any positive effect?
First of all, it's worth noting that Service trigger events shipped with Windows 7.... they're just making better use of this capability in Windows 8. (This is a common flaw with Microsoft's development process for Windows.... they include some really smart new APIs but then take another 5 years to start really using them thoroughly in Windows itself.)
But to your main question -- why are services different from other programs? A service is actually a regular program, with one exception -- it hooks into the operating system to receive events telling it to pause, continue or stop its operation.
Why do this? Management. You don't want 20 different programs with 20 different ways of starting & stopping them.
A feature the Windows Service Control Manager offers is the ability to run your service in a single pooled process alongside other services that require roughly the same privileges on the system. You can see this at work in the Windows 7 task manager -- go to the Services tab and sort the list by PID. If you ever wondered what "svchost.exe" is on a Windows system, or why there are several running on your system, each under different user accounts...... there you go.
With windows 7, memory has become less an issue to me. I just don't care that much; I have 4 gigs, and stuff starts right up when I click on it. As a user, that's all I care about. I could obsess about how much memory is being used at all times, I guess, but what does that metric even mean? I currently have fo:nv, mstsc, 10tabs in ie and ~20 in chrome, everything is still snappy. What does it matter that the system is showing high ram utilization?
What I'd like to see them focus on instead is the file system, and making searches work at least as well as they did in XP. Vista utterly broke file searching ( which is amazing in and of itself ), and while w7 brought back some of the functionality, it's still a crap shoot.
Mod me down with all of your hatred and your journey towards the dark side will be complete!
Hey-- 640K is all you're every going to need. You have my word on that.
---- Teach Peace. It's Cheaper Than War.
Too many people view 'free' memory as a good thing
Windows Task manager does not include cache in its "physical memory" stat, which is the new "memory load". Either that, or none of the (several) boxes I use with Win7 do any caching whatsoever.
It shouldn't need to - you quite literally cannot buy new memory in less than 512GB capacity. That would be like saying "I can run Linux on a Motorola 68000, will Windows 8 do that?" - it won't, because there's very very little market demand for running a new operating system on decade-old hardware.
A mechanism would be interesting where a certain process (say firefox.exe) would have a physical memory cap (say 256MB)
That sort of reminds me of how Mac OS worked in the dinosaur age.
Then again, swap is starting to be a relic of the old days
Not on netbooks and tablets, where the operating system has to regularly swap out applications (on netbooks) or close background applications (on tablets) to free up memory for new tasks.
I still remember at one place I worked they had me clean up a memory leak. Unfortunately I couldn't get it past QA because they didn't understand caching. Basically the deal is that when you free memory it goes back to the memory pool for the process and then the pool decides when to release it to the OS.(Which may be never) So when I freed my memory in debug build the pool immediately returned it to the OS. When QA did that in release the pool held on to the memory and reused it. I even showed them how if you did multiple processes one after the other you could actually see the app use more and more memory while after the fix it would plateau. (Because it was just re-using the memory it had already allocate.) They totally didn't understand, I might as well have explained it to the pavement outside the building. (In the end it just got marked as unfixable. After that if I saw any memory leaks while coding I fixed them as part of other bugs and then didn't mention it to QA.)
Did you know 80 to 90% of the moderators on slashdot wouldn't recognize a troll even if one dragged them under a bridge.
The Black Viper list is pretty good, but the reality is that from Win7 on, the list of OS services that's enabled is the set which won't break something (if you read Black Viper's list they point out what breaks with each service disabled).
And I've not yet figured out how to convince Google Chrome to stop auto-updating (and I don't want to stop flash from auto-updating, flash and pdf are the two biggest vectors for malware out there). I just wish their auto-updaters respected the user and recognized that they should. Larry Osterman wrote an article about this a couple of years ago: http://blogs.msdn.com/b/larryosterman/archive/2007/08/20/applet-mitigations-updaters.aspx
In the old days, there was two ways for a programmer to optimize code; for speed, or for size. You couldn't afford to not design your code, otherwise you would immediately run into memory and performance issues. 16-bit compilers wouldn't allow you to allocate more than 64K at a time. After your application loaded, there would be less than 128K free anyway.
So you would have to take care to plan ahead where and when you were going to use memory. Is the variable going to be a persistent data block that is allocated when the module is first started (IO cache block), something that is just loaded and then discarded (configuration parameters), or loaded until the user no longer wants it (data file). For every variable, you would have to decide whether it was 8-bit, 16-bit or 32-bit, signed or unsigned and assign it accordingly.
Floating point was expensive and you would use fixed-point integers whenever possible, at least until the 80486 came out.
2D FFT on a large image (512x512) was
implemented by loading in each row of pixels separately from disk, applying the transform, and writing out that row again. This would be repeated again for each column.
Even if you did get everything planned out, there was still the chance you would run out of memory. Then you would have to go back and prune every variable for size. Do name strings really need 128 bytes? Do attribute flags really need to be 16-bit? Do coordinates need to be 16-bit?
These days, there are two ways to write code; for shortest project completion time; or for reusable code. Either deadlines are so tight that everyone just throws in code on top of each other, or there is actually time to design and plan ahead.
No one really bothers with whether structure or class variables are 8-bit, 16-bit or 32-bit, or whether an array should have an upper limit of 32, 128 or 1024, whether result codes should be returned to indicate whether the memory was allocated. Just defining variables as 'int' is good enough, and C++ container classes takes care of the dynamic allocation of arrays.
Vintage computer adverts: http://www.vintageadbrowser.com/computers-and-software-ads
I find it difficult to believe that people are buying new machines with less than 4 gig of ram.
General objection: Just because something is cheap doesn't mean we should spend it wastefully. I'd still rather that RAM be put to better use than code bloat. I'd rather the PC be faster, or do more things, or do new things, or be cheaper still. Maybe if software wasn't bloated, PCs would be less than $100 these days. Then we could put that money towards better support.
Specific examples:
dragonhawk@iname.microsoft.com
I do not like Microsoft. Remove them from my email address.