Challenge: 24 processes and 378MB. Possible?

Sun, January 14, 2007, 05:29 PM under Random
For the UK launch of Vista and Office, I am doing a Vista session as expected, but I am also filling a "SharePoint Workflow and collaboration" slot. To prepare for the talk I am running a Virtual PC image of Windows Server 2003 with MOSS on my Vista machine. When I received this image, immediately the challenge was obvious: the VPC image requires 2GB of RAM and my laptop has a total of 2GB of RAM. I lowered the RAM requirement of the image but it would still not start due to lack of memory. I was convinced that I could lower the memory requirements a little and also kill everything unnecessary on my Vista laptop so the host OS used as little memory as possible.

Question: Is there something I can do to a host OS to run the bare minimum since all I am going to be doing is running the VPC and nothing else? No connectivity, sound or anything else required; all I want the machine for is to run full screen the VPC image. Please let me know.

So my steps to minimising RAM use by the host OS was what most people would think:
1. Exit all applications via the X in the top right corner of their window.
2. Right click on all systray icons and select “Exit” (if they offer that option)
3. Run Task Manager. The Applications tab is empty (like the taskbar). Go to the "Processes" tab.
4. Select each unnecessary process and then click the "End Process" button in the bottom right.

At the previous stage you can cause damage so I explicitly do not advise that you kill processes that are not yours. The next stage is even more dangerous so please do not do that.

5. Click on the "Show processes from all users" button. Now you have a whole bunch of more processes to kill. Go to town.
6. After killing more processes than you've ever killed in your life, next let's stop some services. Go to the "Services" tab of Task Manager.
7. For any running service that you think is unnecessary, right click and choose "Stop service".

At the previous step you really are taking your life in your own hands. Only an idiot would stop services they know nothing about so please let me be the only one.

I have gone through this exercise a few times and once I managed to blue screen the machine and another time it just decided to restart with no warning other than slowly dimming the screen to black. I cannot stress enough that the above actions can cause loss of data or permanent failure.

8. My penultimate tip (the last one is at the end in the post script): before doing all of the above make sure you turn off network connectivity since some of the things we are killing result in a less secure machine and also many of the services we are stopping are network related.

Now you know why I asked the question earlier. I know there is a better way to eliminate all unnecessary running processes, but I don't know exactly what it is. This painful process is something I repeat every day since Christmas but at least now I know what to kill and what is either unkillable or comes back to life or if it dies it takes the system with it. It is still irritating having to do all that so please put me out of my misery and tell me how to run a VPC image that uses almost all the RAM of the host machine.

In any case, here is what the "Performance" tab of my "Task Manager" shows after I am done killing:

That's right folks, a Vista machine running with only 395MB and 24 processes. Beat that if you can!! See your task manager right now for how many processes you are running.

I then launch my Virtual PC with the gigantic image, and 12 minutes later the image is loaded and the picture has changed to this:

Yup, 1.72GB used up immediately! Not that life is good from here on cause I have lowered the VPC image's RAM to the extent where it is very slooow regardless... with the occasional failure to render the navigation bar of the SharePoint site.

I can even manage to get the RAM usage down to 378MB as this screenshot proves, which is about half of what I'd normally use when VPC images are not in the picture.

So what do you think: the next time I am asked to do a session that requires a VPC image this big, should I ask for a new laptop to go with it? ;-)

PS The biggest RAM savings I got were by stopping the services “SuperFetch” (trade memory for perf) and “Windows Search” (trade memory for productivity). Getting down to 24 processes included killing “explorer” itself (and launching the VPC image from Task Manager). These 3 actions, plus turning off aero (i.e. no glass) saved me ~150MB.

My WEI score

Sat, January 13, 2007, 09:21 PM under Random
My pathetic WEI (aka WinSAT) is available here where you can also share yours.

iPhone

Tue, January 9, 2007, 06:16 PM under Random
Just followed some links from Loke's blog

It is one cool mother but...

1. Work out how much it will set you back after taking the farcical price tag and adding the rates for data and voice! Who will afford that?

2. No high speed internet access (probably so it doesn’t hurt its already bad battery life)

3. No sync with exchange! That rules out most business users.

4. No physical buttons at all?! I like feedback at my fingertips when answering the phone or sending a txt msg.

5. V1 product to be available in Europe in 11 months.

...but it is sexy... very nice toy indeed!

PS If you are reading this far it means that you didn't work out the cost, did you? ;-)

SideShow devices

Mon, January 8, 2007, 10:14 AM under Windows | Vista | SideShow
Just before leaving for CES, Dan Polivy recorded a short video for on10 showing off 8 SideShow-compatible devices: Asus laptop, LG Z1-p laptop, credit card companion device, remote controls from 3 different manufacturers and Logitech keyboard & speakers!

As always with cool gadgets words are not enough so check out the video and drool :-)

I wonder if the guy behind SideShowDevices will be posting pictures of all these soon...

UPDATE: Also spotted at CES, wearable SideShow device (thanks Keeron Modi for the heads up).

Free copies of Vista and Office

Mon, January 8, 2007, 04:09 AM under Events
Remember the Office and Vista launch I mentioned? Preparing for that has my undivided focus for the next 11 days.

While physical attendance is now sold out, anyone can still participate online; UK residents that do participate online have a chance of winning free copies of Vista and Office! More details on Ian’s blog.

Best of "The Moth" 2006

Mon, January 1, 2007, 06:56 AM under dotNET | MobileAndEmbedded | Windows | Vista | Links
Exactly two years ago on New Year's day, I wrote the Best of "The Moth" 2004 blog enrty where I picked my favorite blog entries out of 96 posts. Exactly one year ago I had to choose from 151 posts to find the ones I thought were the best in terms of content and the result was the Best of "The Moth" 2005.

The year of 2006 I made 142 blog entries and below are a select few. Happy New Year!

01. I didn't have a chance to play with it as much as I wanted to, but with very little public info available, this blog served it well: .NET Micro Framework, its product sheet and other NETMF links.

02. Recognising an idiom of the using statement.

03. A cute desktop feature implemented for the Windows Mobile/WinCE platform in a reusable NETCF control: TextBox cue banner.

04. A picture is worth a 100 words and a video is... a whole bunch of pictures! Check mine out following the instructions here for my nuggets.

05. A comprehensive collection of links for Windows Workflow Foundation (WF).

06. I collected the links to my 9 blog posts on sharing assets between desktop and mobile platforms in one place. Follow the numbered links.

07. The most controversial feature of Windows Vista is something every developer must understand: User Account Control.

08. One of Vista's features is becoming my obsession and that is SideShow. My series of SideShow gadgets blog posts will continue in 2007 and so far you can read parts one, two, three, four and five.

09. I spent 6 months last year focusing almost entirely on Vista developer features that are new and that are *not* part of NetFx3. I have catalogued my blogging & screencasting efforts in a large collection of links to content that supports my speaking engagements on Vista. IMO this blog post alone could have been the best of "The Moth" this year:
Vista-only features for the managed developer.
Stay tuned in 2007 via one of the subscribe options on the left :-)

SideShow notifications and events

Fri, December 29, 2006, 08:44 PM under Windows | Vista | SideShow
When I introduced the SideShow gadget fundamentals, I listed 3 types of communication between the gadget running on the PC and the SideShow-compatible device. You know how to design your SCF content and then download it via the managed API. Here I will introduce notifications and events.

Notification
Sending a notification down to the device takes one line of code, given that you already have a ScfSideShowGadget reference as described before:
Icon ico = new Icon(@"C:\Users\Public\Pictures\SideShow\SSnotification.ico");
g.ShowNotification(
100, // unique content id
"some caption", // caption
"some message", // body
ico, // icon to appear on the far right of the body
TimeSpan.FromSecondss(30)); // timeout interval
Executing the above will result in the behaviour captured below on the SideShow simulator:

The notification will time out after the timeout period specified or the user can manually dismiss it with the ENTER button or, finally, you can programmatically dismiss a notification by its id e.g. g.RevokeNotification(100); or a more brutal approach g.RevokeAllNotifications;

Events
There are 9 events that you can handle programmatically on the PC-side while the user performs actions. The following code shows hooking up to them
g.AllDevicesRemoved += new EventHandler(g_AllDevicesRemoved);
g.ContentMissing += new EventHandler <ContentMissingEventArgs> (g_ContentMissing);
g.ContentNavigate += new EventHandler <ContentNavigateEventArgs> (g_ContentNavigate);
g.ContextMenuSelect += new EventHandler <ContextMenuSelectEventArgs> (g_ContextMenuSelect);
g.DeviceAdded += new EventHandler <DeviceCapabilityEventArgs> (g_DeviceAdded);
g.DeviceRemoved += new EventHandler <DeviceCapabilityEventArgs> (g_DeviceRemoved);
g.GadgetEnter += new EventHandler(g_GadgetEnter);
g.GadgetExit += new EventHandler(g_GadgetExit);
g.MenuSelect += new EventHandler <MenuSelectEventArgs>(g_MenuSelect);
- GadgetEnter, GadgetExit when the user navigates from the glance data page (id=0) to the SCF pages and back.
- DeviceAdded, DeviceRemoved, AllDevicesRemoved when SideShow-compatible device connect or disconnect from this gadget.
- MenuSelect, ContextMenuSelect when the user selects one of your menus or opens your contextmenus.
- ContentNavigate every time the user traverses from one SCF page to another.
- ContentMissing if a user action results in a request for a content id that is not on the device.

The event handler method signatures for these follow the standard .NET pattern of having two parameters. The first being the sender object and the second being a type that inherits from EventArgs. The following class diagram shows the EventArgs classes with their members so you can get an idea of the information you receive with each event mentioned above:


Stay tuned on this blog for more on SideShow gadget development in the new year ;-)

5 things you didn’t know about me

Thu, December 28, 2006, 03:10 PM under Random
MarkJo (whose accent is definitely funnier than mine despite what he claims) has tagged me in this meme... and as my regular readers will know I don’t do memes but, hey, there is always the first time I guess... :-)

1. Before deciding to study computer science in the UK (also known as “before my mum insisted I study”) I was a magician in Greece and actually appeared live on national Greek television. I still have the business cards!

2. When I am behind the wheel I just can’t help speeding. I have 6 points on my license (gained with my Punto GT Turbo); with my brand new Golf GTI 2.0 (200bhp) I am bound to increase them. Problem is that the more points you get the more chances of losing the license and that would most definitely mean losing my job. Not joking, this is a dead serious concern of mine and probably what will force me into working for myself full time from home.

3. I love travelling and have been almost everywhere. If I could live anywhere in the world it would be Australia where I’ve spent 3 unforgettable weeks. Only issue is convincing the wife who prefers Europe as our residence...

4. While competitive at most things I do, the one I always brag about is chess. If you think you have what it takes, challenge me!

5. The last thing you probably don’t know about me is that I have switched the search engine of this blog to LIVE. Check out the cool interface on the left... type “NETMF” in the box and hit enter, you know you want to :-)

Doh... I almost hit “submit”, but this is a meme so I have to tag 5 other bloggers. Let’s see if these guys are listening and want to play:
Angelos , Eileen , Mike , Peter , Scott.

New NETMF web pages

Thu, December 28, 2006, 08:05 AM under MobileAndEmbedded
There is a NETMF book on the horizon and check out its very own book website (thanks Mike for the heads-up).

NETMF also gains its own NETMF MSDN area :-)