6125
« Last post by mouser on April 23, 2015, 07:56 AM »
From the cpu patterns, but more significantly the memory patterns, use you are describing, it sounds like what may be happening is that the delete function (perhaps because it is sending files to recycle bin), is being run asynchronously and creating a new thread for each iteration of the loop, so that essentially the loop is creating thousands and thousands of threads trying to delete files at the SAME TIME, while the loop runs super spawning all of the threads/processes -- rather than it processing each one in turn.
Alternatively, it could be an antivirus program having the same effect.
It would be one thing for the cpu use on one of your cores going to 100%, but the memory use suggests that each iteration of the loop is causing something to be spawned.