Skip to content

Memory issue with sorting_with_executors #17

@alexbarev

Description

@alexbarev
  1. Run sorting_with_executors benchmark using the std::execution::par_unseq policy.

  2. Memory consumption quickly exceeds my machine's availability of 60GB after the second test variant finishes: sorting_with_executors/par_unseq/4194304/

Observations:

  1. Memory does not decrease between tests with inputs of different sizes.

  2. I tried moving the policy inside the loop, but it did not resolve the issue:

    for (auto _ : state) {
        auto local_policy = std::execution::par_unseq; // Create policy here
        std::reverse(local_policy, array.begin(), array.end());
        std::sort(local_policy, array.begin(), array.end());
        bm::DoNotOptimize(array.size());
        bm::DoNotOptimize(local_policy); // even tried this just in case
    }
  3. I noticed that only 16 threads are spawned, which matches the number of available CPU's. The issue is puzzling, and I am yet to understand its root cause.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions