WP7 – How many files does it take to crash IsolatedStorage? (more than you think)

I’ve attended several WP7 training events now and have heard that we can store as much data in isolated storage as the phone can hold.  Apps are not constrained to an arbitrary fixed amount or percentage of phone space.  But how many files can it hold? 

Regardless of file size, I figure the phone file system will only be able to address a certain number of files.  So I started creating files.  Looks like a single app can hold up to 16,352 files before exceptions are thrown. 

Once the limit is hit you start receiving the following generic exception:

image

For further information, I consulted the immediate window but didn’t get much more:

image

I verified that I could still create new files in a second app after the first was full.

What about directories, you say?  Well that was my second question.  It appears the 16,352 limit is per folder and its not only files, its 16,352 files or folders in a folder.  

image

Here you see I added more than 16,000 files spread across two folders.

image

The last question was how many directories deep can I go?  That would be 18.  After which, I hit the same IsolatedStorageException as above for files.  So in theory, this means we could store up to 16352^18 files/folders, that’s

2.71352003763810e+74

This probably isn’t all that useful but it is interesting.  Also interesting, I only noticed a slight slow down in the emulator after adding 16,000+ files to root.  Nice to know.

6 thoughts on “WP7 – How many files does it take to crash IsolatedStorage? (more than you think)”

  1. Hmm… so ur saying that wp7 can hold 2.714e+74 files, so to me that would mean that it could store e^2+74 files. I know you mean 2.714*10^74 folders, but a lower case e is a constant, remember. 2.714=e. So be careful how you write your numbers because us math police are out and about(jk, jk).

  2. Pingback: 超快递 beta版 » Windows Phone 7 资源汇总(超全)

Leave a Reply to rschiefer Cancel reply