On Sun, Sep 15, 2024 at 1:00 AM Alexander Lakhin <exclus...@gmail.com> wrote: > (That is, 0.1-0.2 MB leaks per one robocopy run.) > > I observed this on Windows 10 (Version 10.0.19045.4780), with all updates > installed, but not on Windows Server 2016 (10.0.14393.0). Moreover, using > robocopy v14393 on Windows 10 doesn't affect the issue.
I don't understand Windows but that seems pretty weird to me, as it seems to imply that a driver or something fairly low level inside the kernel is leaking objects (at least by simple minded analogies to operating systems I understand better). Either that or robocop.exe has userspace stuff involving at least one thread still running somewhere after it's exited, but that seems unlikely as I guess you'd have noticed that... Just a thought: I was surveying the block cloning landscape across OSes and filesystems while looking into clone-based CREATE DATABASE (CF #4886) and also while thinking about the new TAP test initdb template copy trick, is that robocopy.exe tries to use Windows' block cloning magic, just like cp on recent Linux and FreeBSD systems (at one point I was wondering if that was causing some funky extra flush stalls on some systems, I need to come back to that...). It probably doesn't actually work unless you have Windows 11 kernel with DevDrive enabled (from reading, no Windows here), but I guess it still probably uses the new system interfaces, probably something like CopyFileEx(). Does it still leak if you use /nooffload or /noclone?