Working out where my PDA space has gone

I mentioned last week that watching Doctor Who made for a good chance to absentmindedly play with some code. I seem to have started a new habit, so thought I’d share what I was worked on this week. 🙂

One of the problems with my HTC Universal is running out of storage space when trying to install new apps. The core Windows Mobile 5 tools that you can use to work out why you’re short of space are fairly limited:

  • Search – listing all files on the device larger than 64KB (an odd size to choose – and without the ability to specify which folder(s) to search in, you end up with a very long list)
  • File Explorer – shows file sizes and lets you sort a folder’s contents by size (but going through each and every folder on the device manually is fairly tedious, and there is no way to get the size of a folder without adding together the size of the contents yourself)
  • Memory applet – showing you how much space available and how much in use (useful to identify that you have a space issue, but not any use in working out why)

You often just look around and rely on trial-and-error to free up space. (Like clearing the Pocket Internet Explorer cache then finding that you have a big chunk of space freed up.)

The aim for yesterday evening was to produce something to visualise the usage of storage space on the device.

Not a terribly original idea (basically a simplified approach to drawing a tree map), but unless my ability to use Google is getting worse, I don’t think anything like this is available for Windows Mobile at the moment.

I think it might be a useful little app, and it only took a bit of an evening to throw together. 🙂

If you’re curious, read more to see some screenshots and a quick description of what I did.

I start off by showing the folders and files in the root directory. With a small screen and slow processor, I don’t do any recursing at this point – just show the relative sizes of the different folders and files in the root directory.

I omitted any external storage like Storage Cards, because they are so much bigger than the device’s own storage that it just completely skews the image.

The colours are fairly hideous – I wrote something to just pick a random character for each block and try not to use the same colour for any adjacent blocks.

I don’t label any of the blocks, because the screen size makes that fairly unreadable. Instead, if you click on any block, I add a black border around it and display the path and size below.

I’ve added a context menu – tap-and-hold on any block to get two (fairly poorly named!) options.

The first option: Drill-down makes it recurse down into the selected directory one level. By breaking it up, you can see what that directory is made up of. So you can see from this screenshot that Tom Tom Navigator makes up a hefty chunk of my “Program Files” directory at 2.63MB.

It only breaks it down by one level – if you want to divide up a sub-directory further, you can do the drill-down again on that sub-directory.

I like this, because it shows the size of a sub-directory in relation to the size of the whole storage. But with such a small screen, you probably don’t want to repeat this too many times as the blocks start getting very small.

For example, this is the sort of thing I can get if I keep drilling down into sub-folders – the Windows folder has a large number of smaller files and folders which are hard to tell apart.

The second option – Zoom in – is an alternative approach. It opens the selected folder up into the whole screen. For example, selecting \Windows and choosing Zoom in gives me:

A break-down of the \Windows directory. It means you lose the idea of how big the contents are in relation to the size of the whole device storage, but it does give me more room to show the contents.

So here I can look at the size of Tom Tom Navigator again – this time in relation to the size of my Program Files folder.

To avoid trying to draw very small boxes, I lump together anything smaller than a certain threshold into an “other” block – giving the size of all of the files lumped together, and the number of files and folders in the block. (With a little slider GUI to change the size of this threshold).

I still have the “Drill-down” menu option for breaking this lump apart though.

By using drill-down on several sub-directories, you can start to produce something approaching a tree-map image…

By default, I only display the device’s main storage. I’ve added a menu item to switch to displaying removable storage like Storage Cards.

So here I can see the size of my video clips directory on my PDA’s microdrive.

And here after breaking the sub-directories further to show the relative sizes of my mp3 folders…

Here is my mini-SD card, showing that the bulk of it is filled with my maps for Tom Tom Navigator.

So there we go – that’s what I’ve done so far. I think I might even end up using it from time to time!

If people think that they might find it useful, let me know and I might bother finishing it off properly!

15 Responses to “Working out where my PDA space has gone”

  1. Zaid says:

    Looks nice. I am using such tools on the PC since ages. Currently Sequoia. I wouldn’t mind trying yours on my HTP P3600. A download link?

  2. dale says:

    It’s not quite ready to be given out just yet… mainly because I’ve been deploying it directly using Visual Studio and haven’t got round to creating an installer project to create a CAB for it yet.

    Also, there is one final kink to work out – free space. I havent yet worked out how to identify the amount of free space – so at the moment the app shows the proportion of storage in use. (This is noticeable, for example, if you look at my 8 gig microdrive you see a very large block representing my 128 meg videos folder – because the microdrive is mostly empty).

    I’ve mentioned before that I’m not good at finishing little bits and pieces like this – but if this is something that might prove useful to others, then I’ll try and make an effort with this one!

  3. Zaid says:

    Don’t stress yourself about that release, you seem to have so much going on already :-). I am using SkTools built-in limited but usable functionality. I will import your RSS and keep reading.

    IMHO the visual displaying of free space does not provide an important piece of information. On Sequoia I ended up hiding it as I want to concentrate on what eats my precious memory.

    By the way, you have a lovely daughter who looks to be as fun to be around as mine: 🙂


  4. dale says:

    I hadn’t seen SKTools before – it looks like they’ve got some neat tools there.

    It’s an interesting point that it might not be worth bothering with free-space (at first, anyway), so I might have a stab at sorting out an installer tonight and put it somewhere for download.

    Oh – and thanks very much for the kind comment about Grace (always appreciated!). Your daughter looks lovely, and you even seem to have managed avoiding turning her into a geek so far – something which I have pretty much given up on with Grace. 😉

  5. dale says:

    Here we go – a link to download the app if you want to give it a try.

    * For Windows Mobile 5 / 6 only
    * For Pocket PC devices (i.e. devices with a touchscreen) only
    * Requires .NET Compact Framework 2

    Comments are welcome

  6. ian says:


    I have a 1Gig card with loads of music on it. So when I get 10 weeks of ‘Best of Moyles’ podcasts, it gets pretty full. This looks like a very good way of finding out if my space is going where I think it is.

    However, I don’t have the .NET framework thingie – I’ll download that and let you know how I get along….


  7. ian says:


    It worked fine for internal memory, but I got errors as per the below link when trying to view my card.

    It says DirectoryNotFoundException but the title bar says ‘/Storage Card’ which looks correct to me….

  8. dale says:

    That’s quite weird… because I didn’t hard-code in paths like “\Storage Card”. I look for all folders in the root directory with FileAttributes.Temporary – so on my device that adds “\Storage Card” and “\Microdrive” to the menu.

    Hmmm… will have to have a think about this one


  9. dale says:

    Ah… it was sometimes having problems with empty directories, which I now handle… wanna re-download it and give it another try? 🙂



  10. ian says:

    That’s fixed it alright.

    It also showed that I had 50Mb of ‘The Ricky Gervais Show’ that I’ve already listened to, so thats freed up a chunk of space. Job done.

    Top marks my man.


  11. Manel says:

    Amazing App. Got very useful, since I had my storage space running out, with all my apps installed on the sd-card, and i had no idea were was it spent.
    Thanks a lot!


  12. David Mitchell says:

    Cool – been looking for this for exactly the same reason – “Who ate all the RAM…?”

    Will d/load & try it

    Thanks for saving me some effort – I nearly had to dust off my coding skills!


  13. Ken says:

    Looks good, I’m going to try it too.

    I was wonder what you are using to do your development?
    Visual Studio?

  14. dale says:

    @Ken – Yeah, I use VS2005.

  15. Kevin says:

    This looks cool. I’m gonna give it a try.