How to Stop sidebar.exe Using Lots of Memory (Edited 14 May 2011)

One of my readers, TED has made a suggestion as to a hack fix to the sidebar.exe memory problem (as documented in my blog post Windows sidebar.exe Memory Leak). With some spare time at the moment, I’ve been able to implement his suggestion and confirm it works.

I’ve written a batch script, and confirmed this works in Windows 7 (should work in Windows Vista too). I created a batch file called restart-sidebar.bat, and stored it in c:\users\brendan – contents of the file below:

@echo off
taskkill /im sidebar.exe /f
echo This script will now sleep momentarily…
TIMEOUT /T 2
echo Starting sidebar.exe now…
start sidebar.exe

The idea is it will kill the process called / task with the image name of, sidebar.exe, forcefully. It will then wait two seconds before starting the process again.

To complete the setup, create a new scheduled task specifying the path to your newly created batch file (mine was c:\users\brendan\restart-sidebar.bat). Run the scheduled task as your own user. I have it scheduled to run once a day at 5pm. I prefer to have it run when I’m not using the computer, more of a scheduled maintenance task that goes on behind the scenes. If you find that’s not enough, schedule it to run a few times a day.

For your information – I’ve encountered on only a few occurrences problems in the past when shutting. The sidebar process has stalled the shutdown procedure and Windows has forcefully killed the process. On login again I’ve lost a few sidebar settings. While I’ve not encountered this running the above batch script, it’s possible you may encounter this. If you’re concerned about it, drop the /f from the taskkill line in the above script (as to not force it) and increase the timeout value from 2, to up to 20 seconds to allow it to safely exit.

Downsides / Cons - I haven’t been able to find something to force the batch file to run in a minimised window (so it pops up and runs as a black command prompt window). This I’m a little bit disappointed with – you could perhaps create a shortcut to the batch file and set the properties on it to start minimised – however I’ve not confirmed this works. – See “Edit 14 May 2011″ below which overcomes this problem.

Advantages / Pluses - It’s a simple and easy fix. Avoids the pain of closing all your programs and restarting / logging off. Runs in seconds and doesn’t require administrative privileges to run.

Edit 14 May 2011 - I recently received an interesting email sent via the contact page. Ray, a fellow sysadmin in the trenches, had come up with a beautiful revision to my own code above. Using the below Windows Script in a vbs file (e.g. restart_sidebar.vbs) run on the same scheduled task as above, it accomplishes the restart of the sidebar without any extra windows or user interaction – it runs silently in the background (like a ninja). I’ve tested it for a few days and it runs beautifully. Thanks Ray, and good work!

‘—————————————————
‘ Author: Ray Flores (raymond.l.flores@gmail.com)
‘ Written May 2011
‘—————————————————

Set WshShell = WScript.CreateObject(“WScript.Shell”)
WshShell.Run “C:\Windows\System32\taskkill.exe /im sidebar.exe /f”, 0, True
WshShell.Run “C:\Windows\System32\timeout.exe /T 2″, 0, True
WshShell.Run “sidebar.exe”, 0, True

VN:F [1.9.16_1159]
Rating: 4.5/5 (2 votes cast)
VN:F [1.9.16_1159]
Rating: +10 (from 10 votes)
1 Comment

What is sidebar.exe

I’ve seen a lot of feedback about the sidebar.exe process running on Windows. I thought it might be beneficial to add some more information about it.

What is sidebar.exe - It’s a genuine Microsoft process / application seen in Windows Vista and Windows 7. It is not dangerous, a virus or malware orientated.

In Windows Vista: It is responsible for displaying gadgets in a bar, usually docked down one side of the screen or screens, hence the term sidebar.

In Windows 7: Like in Windows Vista, while named the same, gadgets run outside of the “bar” and float on the desktop. Gadgets can also be independently docked to the side of a screen or moved around.

Gadgets can have their opacity / transparency adjusted individually (in Windows 7). They can also be set to appear on top – but don’t always depending on the other applications running at the time.

Is it safe - Yes, the process is safe. It is however known to use large amounts of memory at times (especially when using gadgets that interact or feed from the internet). This may slow your computer but it is no way dangerous. To clear memory:

  • Log off and on again
  • Restart the computer
  • Kill the process and start again from the Start menu.

For more information on the large memory consumption of this process, see my other post on the Windows sidebar.exe Memory Leak.

VN:F [1.9.16_1159]
Rating: 4.5/5 (2 votes cast)
VN:F [1.9.16_1159]
Rating: +4 (from 4 votes)
Leave a comment