Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting and stopping the runtime repeatedly seems to leak resources/memory on some systems #715

Closed
msimberg opened this issue Jul 17, 2023 · 0 comments · Fixed by #716
Closed
Assignees
Labels
effort: 2 A few hours of work. effort: 3 A few days of work. effort: 4 A few weeks of work. effort: 5 Who knows how long it'll take? This must be split into smaller tasks. priority: high This is essential functionality or a serious bug. Not addressing this blocks progress. type: bug
Milestone

Comments

@msimberg
Copy link
Contributor

msimberg commented Jul 17, 2023

On some systems (but not all) a test program like

#include <pika/init.hpp>

int main() {
    while (true) {
        pika::start(nullptr, 0, nullptr);
        pika::finalize();
        pika::stop();
    }
}

will eventually run out of memory (typically failing while trying to allocate thread stacks). Changing the pika.thread_queue.init_threads_count configuration option (easily changed with the environment variable PIKA_THREAD_QUEUE_INIT_THREADS_COUNT environment variable) changes the behaviour. The option controls how many thread stacks are pre-initialized at startup. With a high value the failure happens quickly and with a low value the failure is significantly delayed. This would indicate a leak of thread stacks. However, from the looks of it stacks are correctly released at shutdown. Additionally, on some systems memory does not seem to leak. This could indicate a difference in behaviour of mmap/munmap. When PIKA_WITH_THREAD_STACK_MMAP=OFF there seem to be no leaks supporting the mmap/munmap theory. What exactly could be causing this is not clear.

@msimberg msimberg added effort: 2 A few hours of work. effort: 3 A few days of work. effort: 4 A few weeks of work. effort: 5 Who knows how long it'll take? This must be split into smaller tasks. priority: high This is essential functionality or a serious bug. Not addressing this blocks progress. type: bug labels Jul 17, 2023
@bors bors bot closed this as completed in d98a840 Jul 19, 2023
@aurianer aurianer added this to the 0.17.0 milestone Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: 2 A few hours of work. effort: 3 A few days of work. effort: 4 A few weeks of work. effort: 5 Who knows how long it'll take? This must be split into smaller tasks. priority: high This is essential functionality or a serious bug. Not addressing this blocks progress. type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants