Synchronize directories - memory leak when deleting files

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
mario13
New Member
New Member
Posts: 1
Joined: 2010-07-22, 19:40 UTC

Synchronize directories - memory leak when deleting files

Post by *mario13 »

Win7 x64 Ultimate

Dialog Synchronize directories:
When deleting thousands of files from SATA disk, TC occupy in few seconds whole free memory (in my case abou 2 GB). After this, deleting files speed slow down to one file per 1-3 minutes.
First about 300 files are deleted fast.
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Does memory become free after finishing operation? If yes, it is not a memory leak. :)
BTW are you sure it is TOTALCMD.exe process that occupies 2 GB of memory? Maybe it is just file system cache?
User avatar
Hacker
Moderator
Moderator
Posts: 13073
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

wincmd.ini
[Configuration]
VistaDelete=1

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

This is indeed a known bug of Windows Vista/7 - it seems that Windows creates a new thread for each file it is told to delete (via function SHFileOperation). Therefore please use the new delete function suggested by "Hacker".
Author of Total Commander
https://www.ghisler.com
benjamin
Junior Member
Junior Member
Posts: 2
Joined: 2011-08-06, 17:20 UTC

Post by *benjamin »

Hi,

I stumbled over this thread, because I'm having the same issue.
System is Core i7 with 4GB RAM and Win7 x64.

When I synchronize folders with an external esata drive and have to delete a few hundred or more of them TC deletes the first files really fast until about 1GB of RAM is used by the TC process. After that nothing happens. No more files are deleted or it's really slow. Only solution is killing the process through task manager.

I tried to resolve the problem with the VistaDelete=1 option and the Delete through Win Explorer option. Still the problem persists. I'm using TC 7.56a.

I've made a few screenshots. The count of threads occupied by TC is remarkable. If you need anything else just ask.

Edit: I can post the screenshots tomorrow evening because of the spam protection...

Edit2:
If some files have been deleted (about 500 in my example) the CPU load and memory consumption won't reduce after all files in the sync have been deleted. Leaving the sync dialog doesn't have any effect on resource usage too. Only closing TC, before it freezes completely, frees the resources.

Best Regards
Benjamin
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Try deleting with Shift pressed when opening the actual sync copy dialog. Then TC will bypass the recycle bin and delete directly.

VistaDelete=1 still deletes all files separately, because there is a bug in that function: When passing files from multiple directories to it, Windows deletes actually more than just these files...
Author of Total Commander
https://www.ghisler.com
benjamin
Junior Member
Junior Member
Posts: 2
Joined: 2011-08-06, 17:20 UTC

Post by *benjamin »

Thanks for your quick reply.

I removed the VistaDelete=1 option and the Delete through Win Explorer option and tested with about 7000 small files.

Holding Shift while opening the sync copy and delete dialogs works. The error can be reproduced every time when Shift is not pressed.

Btw. I couldn't post the screenshot links now even though I registered on Saturday. The screenshots are not needed anymore. Just posted it for your information.

Best Regards
Benjamin
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48097
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately there is no other solution, the faulty delete to recycle bin functions on Vista/7 just don't work with that scenario (there is no function in Explorer equivalent to what sync delete does).
Author of Total Commander
https://www.ghisler.com
Post Reply