ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

DONE: Delete every N files, or keep only every N files

<< < (3/4) > >>

mouser:
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.

skwire:
I set up a couple of test folders, each with 80,000 one meg files.  From my tests, using FileRecycle will cause the issues you saw.  When I used FileDelete, the script took about five seconds to run with little to no hit to CPU and RAM.

Deozaan:
I set up a couple of test folders, each with 80,000 one meg files.  From my tests, using FileRecycle will cause the issues you saw.  When I used FileDelete, the script took about five seconds to run with little to no hit to CPU and RAM.
-skwire (April 23, 2015, 09:21 AM)
--- End quote ---

Well shoot! Looks like I picked the wrong one. Thanks for getting to the bottom of this. And thanks for the script in the first place. :Thmbsup:

skwire:
You're welcome.  Thanks for the DC credits, too.   :D

Stoic Joker:
Be aware that having a (1) directory with ~80,000 files in it will bring Explorer, and other tools looking at that file-list, to a crawl :'(-Ath (April 23, 2015, 01:59 AM)
--- End quote ---

Damn it! ...So what is the best way to store porn?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version