-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Internal Code
-
None
-
Fully Compatible
-
ALL
-
- Get a windows-64-vs2019-nonprod spawnhost
- Build and run dbtest or util_test
- Watch the memory usage go crazy.
-
Service Arch 2020-01-27
While undertaking some experiments with VS2019 (it cuts our build times in half), we found that several unit tests and the dbtests had very rapid memory leaks.
Investigation has revealed ClockSource::waitForConditionUntil is passing a mocked deadline to a wait_until call on a system condition_variable that is using the system clock. Since the mocked values are very small, the wait is skipped. The erroneous line is here: https://github.com/mongodb/mongo/blob/b157e332ffe0963c8c503bb9ecb380fd158e0871/src/mongo/util/clock_source.cpp#L87
The result is that we spin hard in https://github.com/mongodb/mongo/blob/b157e332ffe0963c8c503bb9ecb380fd158e0871/src/mongo/util/clock_source.h#L117-L120, and each iteration allocates a new AlarmInfo .
One truly curious thing is why this only appears to be an issue on the VS2019 images, and doesn't seem to cause problems on the VS2017 builders.
- is depended on by
-
SERVER-45238 Some unit tests have massive memory leaks when built with VS2019
- Closed
- is duplicated by
-
SERVER-45238 Some unit tests have massive memory leaks when built with VS2019
- Closed