Skip to content

Commit

Permalink
Fix: Workaround for a memory leak in libstdc++
Browse files Browse the repository at this point in the history
Reference: ashvardanian#17
  • Loading branch information
alexbarev committed Jan 6, 2025
1 parent b6d7bd2 commit 998ec82
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion less_slow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,21 @@ BENCHMARK_CAPTURE(sorting_with_executors, seq, std::execution::seq)
->Complexity(bm::oNLogN)
->UseRealTime();

/**
* Memory leak observed in libstdc++ using oneTBB under specific conditions:
* @see Github issue: https://github.com/ashvardanian/less_slow.cpp/issues/17
*
* A workaround is implemented by limiting the number of iterations
* for this benchmark to a single run.
*
* This adjustment is applied to the benchmark below:
*/
BENCHMARK_CAPTURE(sorting_with_executors, par_unseq, std::execution::par_unseq)
->RangeMultiplier(4)
->Range(1l << 20, 1l << 28)
->MinTime(10)
// Uncomment when issue resolved
// ->MinTime(10)
->Iterations(1)
->Complexity(bm::oNLogN)
->UseRealTime();

Expand Down

0 comments on commit 998ec82

Please sign in to comment.