I wrote a C++ program that lists all top-level windows and gives user an ability to live capture any of them using GDI.
Basically, there runs a Windows timer with 0 delay pointed (of course, there no zero delay) - it gets specified window's DC, blits it to compatible GDI HBITMAP
, GetDIBits
of that bitmap to char
array and finally creates ID2D1Bitmap
from that char
byte data, that is being rendered via Direct2D. And all of that many times per second, so I can get about 60fps cast from window.
All data is being free, and the task manager says, that the memory of the process is not raising, but the page fault value, exactly after I choose window to start being captured is growing up.
After about 10 minutes there are almost 100 millions page faults, as task manager displays. It grows up with about 100k units per step, despite, as I already wrote memory is not raising, so, I assume there is no memory leak.
The process with the nearest page fault count value - msedge.exe has only 5 millions page faults, running for about ten hours. It raising for Edge also, but not so fast as in my program.
I read that big page fault value can reduce the performance, but currently it seems to be ok.
So is it ok? Should I do something?