elastic / ml-cpp

Machine learning C++ code
Other
149 stars 62 forks source link

[Backport][ML] Remove allocators from cache after usage (#2679) #2681

Closed valeriy42 closed 2 months ago

valeriy42 commented 2 months ago

In the CBoostJsonWriteBase class, we maintain a cache of allocators that should be reused when we write new results. Although we took measures to free memory in these allocators, it was still not entirely possible. As a result, we noticed a gradual increase in memory usage by native processes due to the increasing size of the allocators in the cache.

This PR ensures that the allocator is removed from the cache and the memory is freed.

Backport of #2679 to 8.14

valeriy42 commented 2 months ago

buildkite run_qa_tests on linux