What is ENABLE_FCB_GARBAGE_COLLECTION for?

48 views
Skip to first unread message

Armin Schrenk

unread,
Sep 10, 2021, 7:55:44 AM9/10/21
to Dokan

Hey,

i recently noticed some new options for Dokan_Options for mounting. One I'm specifically interested in is ENABLE_FCB_GARBAGE_COLLECTION.

The doc states that it can improve preformance for certain operations. My question is, why it is not used by default? Are there any drawbacks activating this flag? In the Windows documentation FCB is found in the network driver section so does it even has an impact when not using the dokan network provider?

Best,
infeo

Armin Schrenk

unread,
Sep 10, 2021, 7:57:07 AM9/10/21
to Dokan
For anyone interested, documentation about FileControlBlocks can be found here: https://docs.microsoft.com/en-us/windows-hardware/drivers/ifs/the-fcb-structure

Liryna

unread,
Oct 1, 2021, 10:16:30 PM10/1/21
to Dokan
Hi Infeo,

Sorry for the delay. I totally missed this thread.

* The advantage of the FCB GC approach is that it prevents filter drivers (Anti-virus)
* from exponentially slowing down procedures like zip file extraction due to
* repeatedly rebuilding state that they attach to the FCB header.

What is happening is that by default Dokan delete the FCB object right after all handles on this file are closed (There is 1 FCB per file regardless how many handless are open on it).
This release system resources that some filter drivers might recognize as the file was removed. If the file is reopened right after, the filter drivers will reconstruct around the new instance which is fine but if this happens on a large set of files, you will see the difference.

Why it is not enabled by default ? Just because I prefer to let people choose to turn it on or not and not be surprised by a new "non vital" feature being enabled by default.

Best regards,
Liryna

Armin Schrenk

unread,
Nov 5, 2021, 7:30:26 AM11/5/21
to Dokan

No problem! Thanks for the answer, I have now a better understanding of what this option is doing.
Reply all
Reply to author
Forward
0 new messages