Message: Re: thread local singleton memory leak? Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: thread local singleton memory leak? 

Forum: Multithreading
Re: Question thread local singleton memory leak? (Tianyu Liu)
Date: 05 Sep, 2017
From: Andrea Dotti <Andrea Dotti>

Hello, I think there is a misunderstanding. The memory-leak indicated in the documentation regards the use of singletons (thread-local or not) created on the heap, with respect to the stack. The new utility we have introduced solves this problem.

However it is true that in our source code there are still (too many) "old style" singletons that cause a memory leak. However please consider that, by their nature, singletons exist in one and only one instance (possibly per-thread) during the full life-time of the application. Thus we can consider this as a kind of "minor" memory leak, because the memory is allocated once and freed at the exit of the application (without calling the object destructor). I recognize, however, that this is a bad design, and we are trying to improve the code.

Regards, Andrea

 Add Message Add Message
to: "Re: thread local singleton memory leak?"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews