You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There appears to be a memory leak when calling CFHD_PrepareToEncode. I've only tested on Windows 10.
I first observed this in some unit tests for my encoder (the unit test calls _CrtDumpMemoryLeaks), so to try and confirm the problem, I tried an infinite loop of creating an encoder, calling PrepareToEncode, and closing the encoder, to see how the process VM usage grows over time.
Using 8fd6bba from 'master' (9 Nov 21), build the solution with VS 2019 x64, and then insert the following at the very start of main() in TestCFHD.cpp
while (true)
{
CFHD_EncoderRef enc = nullptr;
CFHD_Error res = CFHD_OpenEncoder(&enc, nullptr);
if (res != CFHD_ERROR_OKAY)
return res;
res = CFHD_PrepareToEncode(
enc,
320,
160,
CFHD_PIXEL_FORMAT_RG24,
CFHD_ENCODED_FORMAT_YUV_422,
CFHD_ENCODING_FLAGS_NONE,
CFHD_ENCODING_QUALITY_DEFAULT);
if (res != CFHD_ERROR_OKAY)
return res;
CFHD_CloseEncoder(enc);
}
Watch the process memory usage in something like Windows Task Manager.
The VM usage grows sharply with smaller resolutions (like 160x80, 320x160, etc) but much slower with higher resolutions.
The text was updated successfully, but these errors were encountered:
There appears to be a memory leak when calling CFHD_PrepareToEncode. I've only tested on Windows 10.
I first observed this in some unit tests for my encoder (the unit test calls
_CrtDumpMemoryLeaks
), so to try and confirm the problem, I tried an infinite loop of creating an encoder, calling PrepareToEncode, and closing the encoder, to see how the process VM usage grows over time.Using
8fd6bba
from 'master' (9 Nov 21), build the solution with VS 2019 x64, and then insert the following at the very start ofmain()
inTestCFHD.cpp
Watch the process memory usage in something like Windows Task Manager.
The VM usage grows sharply with smaller resolutions (like 160x80, 320x160, etc) but much slower with higher resolutions.
The text was updated successfully, but these errors were encountered: