Disable caching for file copy and move actions

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Thany
Senior Member
Senior Member
Posts: 293
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Disable caching for file copy and move actions

Post by *Thany »

It would be nice if TC disables the windows filecache when file are copied or moved. I think the file cache shouldn't be used for copy and move actions because with large (or a lot of) files it causes application memory to be written to the pagefile... So afterwards my computer is very slow because the pagefile needs to be acessed wildly (while that's very rarely neccesary with my 512MB).

/geek mode:
Christian, you can do this by passing the FILE_FLAG_NO_BUFFERING flag to the CreateFile function for both source and destination files. You might also consider adding the options to write files using the FILE_FLAG_WRITE_THROUGH flag.
User avatar
Coco
Senior Member
Senior Member
Posts: 223
Joined: 2003-02-07, 13:35 UTC
Location: Belgium
Contact:

Post by *Coco »

Alain
Thany
Senior Member
Senior Member
Posts: 293
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Post by *Thany »

It's not a problem I can solve myself. It's also definately not a memory leak. It's just windows filecache, a feature which is a lot over-used even by windows itself.

FYI: I have the same symptons when copying or moving a large file (or a lot of smaller files) with any other program, even with the windows explorer.

The workaround is to open up some programs afterwards. Their files are being cached again, and the computer becomes faster. The filecache shrinks and physical memory available to application restores to normal.

The solution is more difficult and has to be implemented by the programmer, as I mentioned in my start post.
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

You can shrink the memory usage by setting the
CopyHugeBlockSizeOther
CopyBlockSizeOther
CopyHugeBlockSize
CopyBlockSize
parameters in the ini file. I know it doesn't set the cache size, but it also consumes valuable memory.
I switched to Linux, bye and thanks for all the fish!
Thany
Senior Member
Senior Member
Posts: 293
Joined: 2003-09-30, 09:20 UTC
Location: Netherlands

Post by *Thany »

No, no, no!

for the third time: I was referring to the WINDOWS filecache, it doesn't have to do anything with TC, except for the fact that it can (and should!) be turned of for a certain files.

BTW, you raise a point: why are those buffers even variable? TC should simply choose the fastest :)
User avatar
Hacker
Moderator
Moderator
Posts: 13144
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

why are those buffers even variable? TC should simply choose the fastest
:) If it would be that easy I am sure it would.

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
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

Hacker wrote:
why are those buffers even variable? TC should simply choose the fastest
:) If it would be that easy I am sure it would.

Roman
And sometimes it is not the fastest what we want, but fast system response during copy, see SlowCopy ;-)
I switched to Linux, bye and thanks for all the fish!
User avatar
SanskritFritz
Power Member
Power Member
Posts: 3693
Joined: 2003-07-24, 09:25 UTC
Location: Budapest, Hungary

Post by *SanskritFritz »

Thany wrote:I was referring to the WINDOWS filecache, it doesn't have to do anything with TC, except for the fact that it can (and should!) be turned of for a certain files.
I definitely understood you, but we are talking about memory consumption, where those parameters are playing a big part.
I switched to Linux, bye and thanks for all the fish!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50839
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

When copying with these parameters:
CopyHugeBlockSizeOther
CopyHugeBlockSize

The Windows file cache will be bypassed.
Author of Total Commander
https://www.ghisler.com
Post Reply