[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GNUstep and valgrind
From: |
Andreas Fink |
Subject: |
Re: GNUstep and valgrind |
Date: |
Tue, 20 Mar 2018 08:59:08 +0100 |
>
>> How GnuStep has implemented drain vs. release I would have to check. But if
>> you follow the Apple documentation, the GnuStep implementation should follow
>> along (with a few exceptions which are not implemented [yet]). So calling
>> drain would be a safe bet.
>
> Indeed. It is safer. Unless you have code that you still want to compile on
> <OS X 10.4 systems. Then, release is safer because it still works on 10.13.
>
> So it seems to be impossible to find a general answer :(
the answer would be to have the compiler use @autoreleasepool { } ...
(I wonder if thats any different in reality)
>
> Anyways, this does not help the original leak issue.
>
One thing to be careful about , especially in embedded systems who run as
background tasks, is the fact that every thread has its own autorelease pool.
And long running tasks should drain their pool frequently.
Some errors I had in my daemons in the early days was like having a way too big
autorelease pool which almost never gets drained. So objects where piling up
all the time. My stuff is heavily multithreaded and I have background threads
which sit on sockets and live long. So when you read from sockets, process some
stuff and read from sockets again, you need to have temporary pools being
created on the fly.
What I often do is to run my own multithreaded execution queue. So if I have a
task to do, I throw an object on to the queue. The queue executor then picks an
object, creates an autorelease pool, calls the object's main method and drains
the pool.
- Re: GNUstep and valgrind, (continued)
- Re: GNUstep and valgrind, amon, 2018/03/19
- Re: GNUstep and valgrind, Fred Kiefer, 2018/03/19
- Re: GNUstep and valgrind, Richard Frith-Macdonald, 2018/03/19
- Re: GNUstep and valgrind, amon, 2018/03/20
- Re: GNUstep and valgrind, amon, 2018/03/20
- Re: GNUstep and valgrind, H. Nikolaus Schaller, 2018/03/20
- Re: GNUstep and valgrind, Andreas Fink, 2018/03/20
- Re: GNUstep and valgrind, H. Nikolaus Schaller, 2018/03/20
- Re: GNUstep and valgrind, Andreas Fink, 2018/03/20
- Re: GNUstep and valgrind, H. Nikolaus Schaller, 2018/03/20
- Re: GNUstep and valgrind,
Andreas Fink <=
- Re: GNUstep and valgrind, David Chisnall, 2018/03/20
- Re: GNUstep and valgrind, Wolfgang Lux, 2018/03/20
- Re: GNUstep and valgrind, David Chisnall, 2018/03/20
- Re: GNUstep and valgrind, Richard Frith-Macdonald, 2018/03/20
- Re: GNUstep and valgrind, Richard Frith-Macdonald, 2018/03/20
- Re: GNUstep and valgrind, amon, 2018/03/20
- Re: GNUstep and valgrind, Riccardo Mottola, 2018/03/20
- Re: GNUstep and valgrind, amon, 2018/03/20
- Re: GNUstep and valgrind, David Chisnall, 2018/03/18