Huge trashcan can make TC unresponsive

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Hakker
Junior Member
Junior Member
Posts: 23
Joined: 2009-03-01, 14:48 UTC

Huge trashcan can make TC unresponsive

Post by *Hakker »

As I was sorting through a massive wallpaper folder I had with about 16000 files I had to copy and delete a lot of files over and over to get the folder structure I wanted.
During that process my trashcan kept filling and filling and at one point it had about 40000 files in it.
anyways I did find a nice bug that way. As files kept accumilating in the trashcan TC got crazy. CPU usage was at 23-27% (1 of 4 cores basically) and memory usage went to 1000-1400MB and it became unresponsive in the end.
Sure it's somewhat of an extreme measure I used I guess but heck it is what I found.

I hope it makes sense because it's the best way I can explain it. I doubt it's something that needs immediate attention since the conditions aren't really normal but I figured I just post it.

Just some basic system info that it's not reaching a limit there
CPU: Core I7 920 @ 3,33 GHz
Mem: 12 GB
User avatar
karlchen
Power Member
Power Member
Posts: 4603
Joined: 2003-02-06, 22:23 UTC
Location: Germany

Post by *karlchen »

Hello, Hakker.

Yes, this is a known fact and has been reported more than once before.
As you are using a 64-bit Windows version, chances are it will be Vista 64-bit or Windows 7 64-bit or maybe even Server 2008 R2.

In any of the 3 cases, you may be lucky and reduce the effect by configuring Total Commander 7.56a to use VistaDelete=1.

Section [Configuration]:
Win95Delete=0
VistaDelete=1

HTH,
Karl
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Indeed normal deleting to recycle bin is broken on Windows Vista and newer - they seem to create a new thread for every single file! This problem didn't exist in Windows XP and earlier. So the solution is indeed VistaDelete=1 (also on Windows 7).
Author of Total Commander
https://www.ghisler.com
Hakker
Junior Member
Junior Member
Posts: 23
Joined: 2009-03-01, 14:48 UTC

Post by *Hakker »

I actually had that already changed in the ini file and it still did this. I guess I should have mentioned it in the opening post ;)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm not aware of any problems with the new Vista delete method - it deletes all the files in the same thread. However, it's still recommended to empty the recycle bin regularly.
Author of Total Commander
https://www.ghisler.com
prorokrak
Junior Member
Junior Member
Posts: 9
Joined: 2011-04-17, 10:58 UTC

Post by *prorokrak »

I have to confirm similar issue.

I had a lot of files in Recycle Bin (over 30 000), ran deletion of several thousands of files with VistaDelete=1. CPU usage of "totalcmd.exe" ran almost 90% high (AMD x4 3,4GHz). "Working Set" of the same process ran over 1GB (normal is some 40MB).

I did some research on the forums a tried some tests and here are my findings:
When I delete a folder structure (with tens of directories and thousands of files) with VistaDelete=1, it works like a charm.

However, when I need to delete a lot of files selected in Branch View (for example because I need to do some filtering), then it burns my CPU and consumes huge amount of memory - once, it even caused such an exhaustion of system resources that I had to restart my system.

As I read somewhere on the forums, VistaDelete=1 cannot be used on files from different folders. I think it's quite bad, because deleting huge amounts of (filtered) files in branch view can be very common operation.

A note: I tried the tests also with clear instalation of TCMD in default setting, in Safe mode to avoid collisions with AV and other software and also collision with plugins.

My operating system is Win7 Pro 64bit. CPU: AMD x4 3,4GHz, RAM: 4GB.
User avatar
HolgerK
Power Member
Power Member
Posts: 5406
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

I guess the main difference between TC-Delete and VistaDelete is that VistaDelete moves a folder to recycle bin, while TC delete moves every single file of the folder separately.
History.txt wrote:19.06.09 Added: wincmd.ini [Configuration] VistaDelete=1 enables special delete method to recycle bin on Vista and Windows 7: Directories are moved as a whole to the recycle bin. No warning for read only or hidden/system files!
Assuming that every single delete operation consumes some resources, the number of operations is simply lower than.

Just out of curiosity(*):
Is there a difference in using explorer delete method?
Or in using Explorer while deleting a lot of single files?

Regards
Holger

(*) seldom running in such problems because my recycle bin contains 0 Files most of the time.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

when I need to delete a lot of files selected in Branch View (for example because I need to do some filtering), then it burns my CPU and consumes huge amount of memory - once, it even caused such an exhaustion of system resources that I had to restart my system.
This is because the VistaDelete function cannot handle the deletion of files from various directories - it's a bad bug in that function which causes Windows to delete even wrong files! Therefore TC has to delete the files one by one in branch view.

If you can, delete entire directories instead - or move the files elsewhere before deleting them.
Author of Total Commander
https://www.ghisler.com
prorokrak
Junior Member
Junior Member
Posts: 9
Joined: 2011-04-17, 10:58 UTC

Post by *prorokrak »

Just out of curiosity(*):
Is there a difference in using explorer delete method?
Or in using Explorer while deleting a lot of single files?
OK, Holger, I tried what you have asked.

Here is the description of my additional tests:

Test overview:
I created two test folders with identical content. In every folder there was over 21 000 files.
Recycle Bin was empty in the beginning of tests.

I used different delete methods to proceed the following actions.
  • Delete files in folder 1.
    Delete files in folder 2.
    Restore over 42 000 files from Recycle Bin.
    Delete over 42 000 files from folder 1 and 2 in branch view (only when using TC).
Everytime I checked CPU usage and working set in Process Explorer.

Short story:
When I was deleting files from one folder after another, there was no significant difference in delete method. Whether I used Windows Explorer, Explorer method in TC, or standard method in TC with VistaDelete=1, CPU usage and Working Set was in reasonable boundaries (main difference was that Windows Explorer used more CPU (50%), working set was maximum 320 MB). It didn't matter whether Recycle Bin was empty or full. The operation took some 30 secs for every folder (however, I didn't do exact timing).

The same was true when I was deleting the files from both folders in branch view with Explorer method (of course, working set went higher - to 500 MB and it took longer, maybe over 1 minute, but that is absolutely comprehensible).

When using standard delete method with VistaDelete=0 (in one folder) it burned CPU to 80-90% and working set went as high as 1 150 MB, but then, fortunately, stopped getting higher - so the main drawback was intolerably long time needed to finish the operation (tens of minutes).

When using standard delete method with VistaDelete=1(!) to delete files from both folders in branch view, it burned CPU to 80-90% and working set went so high, it caused BlueScreen - it just knocked out whole system!!! Moreover, it took eternity (or, more exactly, some 10 minutes to knock down my system after deleting some 7 500 files. Just to highlight the difference, deleting 21 0000 files from one folder when using other methods took less than 1 minute.).

Conclusion:
I really appreciate the hard work Christian have done with TC. VistaDelete=1 can do some good in certain situations, but I really feel it would be needed to improve standard delete method on 64-bit systems, because it can have seriously adverse impact on whole system. While using Explorer method is a solution, I consider it for temporary, since it cannot handle comments. Moreover, a disadvantage of this method is that it takes quite a long time to show confirmation question when a lot of files is selected (140 seconds with over 42 000 files selected against 1 second with the same selection and standard TC method).

Long story:
If someone would be seriously interested in detailed description of my tests and results, I could write down detailed report. For now, however, I didn't want to waste my (and others) time, if nobody cares.[/list]
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ghisler(Author)
Do you use IFileOperation:DeleteItem multiple times or do you use IFileOperation:DeleteItems to add the items to the list and IFileOperation::PerformOperations to commit the action?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48079
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I'm using DeleteItem() for each file, and then call PerformOperations to commit the action. It doesn't work correctly when the files passed to DeleteItem() are in different directories.
Author of Total Commander
https://www.ghisler.com
Post Reply