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

6 Comments

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.

1 Comment

Delete PC Sync Calendar on HTC Desire

How it started – Work saw fit to give me a work mobile/cell phone. I already have an iPhone for personal use, and I’m no fan boy, so I opted for a HTC Desire running Android 2.2. I wanted to experience another operating system, try new things, who knows it might be better than what I’ve got now.

The Problem – My new HTC is really good at syncing things, too good in fact. I plugged it into my personal computer to play with the HTC Sync program (you know, sync some music for the drives to work). For reasons unbeknown to me, I also told it to sync my personal calendar. The calendar syncs to the HTC Desire to a calendar named “PC Sync”. After realising my mistake I sought to delete the calendar – after all it’s a personal calendar on a work phone, it’s reminding me about all my personal appointments and I don’t like it. So I plug the phone back into my personal computer, open HTC Sync and turn off the calendar syncing. After the lengthy synchronize process completes I check my calendars: Personal Calendar (from Google), PC Sync, Facebook and Exchange. Whaaa? The PC Sync calendar is still there!

The Problem Escalated – Annoyed, I then open the calendar application on the HTC Desire, press Menu > More > Calendars. It’s still there! I press Menu > Remove Calendars and the option to delete the PC Sync calendar is not available. I’m stuck with the calendar with all my personal events on it and no way to remove it – beyond deleting weeks worth of entries one by one, I’m a little lost as to what to do next. The outlook is grim.

The Grinding – Google! My friend! I start running some searches around Google looking for other people experiencing the same problem. There are. But no resolution. All I find are lame responses from know it all people who really know nothing. Some suggests using another Sync program – a little overkill isn’t it? I just want to remove a calendar?

I’d been searching for a good 10 minutes, when I light globe lit up…

The Solution – I recall some weeks back deleting some applications after being prompted that my (tiny) SD card was running out of space. I went into Settings,  Applications and then Manage Applications – and proceeded to start deleting games I’d downloaded (strictly work related of course). I recalled there was a button on this screen called Clear Data.

With hast, I picked up my HTC Desire mobile phone, unlocked it, tapped Settings > Applications > Manage Applications > “All” tab and searched for the word Calender. There were three applications – Calendar, Calendar Storage and Calendar Sync Adapter. Doesn’t Calendar Storage sound convenient? I tapped Calendar Storage and then Clear Data. Upon checking my calendars, I’d lost all my calenders and their data – all calendar related data was gone.

Work uses Microsoft Exchange (to my disgust) – so I opened Settings > Accounts & Sync > Exchange ActiveSync > Sync Now which repopulated my calendar with all my work calendar data, appointments and meetings. I’m pretty sure if I did the same for the Google account I’d sync that calendar back too – but since I don’t use it I didn’t bother.

All my calendar information is stored elsewhere and synchronised to my phone. All my calendar information (I wanted) could be recovered again.

In Summary – When syncing your calendars with the HTC Sync program to your HTC phone, it seems that you can’t un-sync or delete the PC Sync calendar once synched. It seems like such a simple thing to do, but not well thought through by the developers it seems. I found and used a less obvious method of deleting the calendar – deleting all the calendar data via the application manager. This meant all my calendar data was deleted. This was intentional and I knew I could recover what I needed. Only proceed if you know you can recover your calendar data from another source. A backup beforehand probably wouldn’t go astray either.

These are the steps I took on my HTC Desire running Android version 2.2 to delete all calendar data, and in turn the PC Sync calendar:

  1. On the phone, open Settings > Applications > Manage Applications
  2. Click the “All” tab at the top of the screen
  3. Scroll down and tap the Calendar Storage application
  4. Tap the “Clear data” button, and confirm you’d like to proceed.

Now all the calendar data is gone from the phone, running your sync processes again to populate only the calendars you want on your phone.

So, if you’re stuck and need to remove this darn annoying calendar – I hope my experience here has been able to help.

2 Comments