Opened 7 years ago
Closed 6 years ago
#11951 closed Bugs (fixed)
Memory leak in boost::when_all
Reported by: | Owned by: | viboes | |
---|---|---|---|
Milestone: | Boost 1.62.0 | Component: | thread |
Version: | Boost 1.60.0 | Severity: | Regression |
Keywords: | future continuation leak | Cc: |
Description
After trying to identify the source of huge memory leak in our product we found that problem sits inside boost::when_all.
I have written a minimal program to demonstrate it. It simply constructs many promises, extracts the future from them and assign continuation to boost::when_all future. Then it waits for completition and loop.
Run htop
and see how memory infinitly consumes in time at ~300-400 kb/sec. I have run this test on OS X (El Capitan) and Ubuntu 15.10. On Linux also virtual memory (address space) consumed at ~1 GB/sec rate!
ifdef-ed part of code are used to run on valgrind and test that future's target objects are NOT leaked.
Attachments (1)
Change History (9)
by , 7 years ago
Attachment: | when_all.cc added |
---|
comment:1 by , 7 years ago
comment:2 by , 7 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 6 years ago
Sorry for been late.
It seems that the source and the stack doesn't match. Could you reload them?
comment:5 by , 6 years ago
I should use a weak_ptr instead but for the time been I don't reach to make it working. Any help much appreciated.
comment:6 by , 6 years ago
I have committed
https://github.com/boostorg/thread/commit/5450e98c6bd2515388de1d3d97431cf5374319e7
Please, could you tell me if this fixes the issue?
comment:7 by , 6 years ago
Milestone: | To Be Determined → Boost 1.62.0 |
---|
comment:8 by , 6 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Valgrind output: