From my testing, it seems that erasing occurs with all applications that are not currently working, when the use of space on the device EXCEEDS the number of messages (as if the iPhone is in the space available to prevent it from falling into the reserved space), When you cross this line, appears dialogue:

And when you press this, he then wipes the space. This is the only situation where I was able to play reliably in order to start cleaning (for testing / etc), and I did this by filling my device as much as I could with movies and music, and then uploaded large files to DropBox.
source
share