[
https://issues.apache.org/jira/browse/MINIFICPP-839?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16844755#comment-16844755
]
Daniel Bakai commented on MINIFICPP-839:
----------------------------------------
I'm submitting a pull request which tries to fix all these issues except the
FlowController.
With that pull request tests (not using FlowController) now don't leak memory.
FlowController is not that trivial to fix (I don't want to rewrite every
reference to it to a weak_ptr). [~aboda] suggested that we might make it a
singleton, and that seems like a good idea to me.
[~phrocker] ?
> Multiple memory leaks because of shared_ptr cycles
> --------------------------------------------------
>
> Key: MINIFICPP-839
> URL: https://issues.apache.org/jira/browse/MINIFICPP-839
> Project: Apache NiFi MiNiFi C++
> Issue Type: Bug
> Reporter: Daniel Bakai
> Assignee: Daniel Bakai
> Priority: Blocker
> Labels: ReloadValidation
> Fix For: 0.7.0
>
>
> There seems to be a Connection<->Processor shared_ptr cycle which means that
> the Processors never get destructed.
> This causes leaks in reloads and in tests.
> There are also other cycles causing leaks:
> * Connection <-> FlowFile (this seems to be partially mitigated by
> Connection::drain(), but not entirely)
> * ResourceClaim <-> VolatileContentRepository
> * VolatileContentRepository <-> VolatileContentRepository (capturing a
> shared_ptr into a thread func and detaching the thread)
> * FlowController <-> SchedulingAgent (TimerDrivenSchedulingAgent,
> EventDrivenSchedulingAgent, CronDrivenSchedulingAgent) and even
> FlowController <-> util::ThreadPool because of this
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)