Garbage collector & Memory Profiling
Hello, We are currently working on memory profiling and we are having troubles to detect when an object is garbage collected. Any ideas? Thanks for the help, Alejandro Infante
There is the StrongPointerExplorer in the image that can help... But it is not easy to know when an object is GC. 2013/7/30 Alejandro Infante <alejandroinfante91@gmail.com>
Hello, We are currently working on memory profiling and we are having troubles to detect when an object is garbage collected.
Any ideas?
Thanks for the help, Alejandro Infante
probably because the whole idea of having a GC is to forget/not having to think in when it is collected :) On Tue, Jul 30, 2013 at 10:27 PM, Clément Bera <bera.clement@gmail.com>wrote:
There is the StrongPointerExplorer in the image that can help...
But it is not easy to know when an object is GC.
2013/7/30 Alejandro Infante <alejandroinfante91@gmail.com>
Hello, We are currently working on memory profiling and we are having troubles to detect when an object is garbage collected.
Any ideas?
Thanks for the help, Alejandro Infante
As far as I know, that's not possible in Pharo unless you explicitly register the desired objects in "WeakRegistry default" or similar (and implement #finalize). I think is the closest you have. Cheers, On Tue, Jul 30, 2013 at 5:00 PM, Alejandro Infante < alejandroinfante91@gmail.com> wrote:
Hello, We are currently working on memory profiling and we are having troubles to detect when an object is garbage collected.
Any ideas?
Thanks for the help, Alejandro Infante
-- Mariano http://marianopeck.wordpress.com
On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <marianopeck@gmail.com> wrote:
As far as I know, that's not possible in Pharo unless you explicitly register the desired objects in "WeakRegistry default" or similar (and implement #finalize). I think is the closest you have.
Cheers,
A few clarifications: - You can use a non-default WeakRegistry (usually one specific to your domain, to avoid cluttering of the default one) - You can specify a custom executor (any object which implements #finalize), rather than implement #finalize on objects you're interested in. obj := Object new. executor := ObjectFinalizer receiver: Transcript selector: #show: argument: 'Object GC''d!'. myReg := WeakRegistry new. myReg add: obj executor: executor. obj := nil. Smalltalk garbageCollect. Cheers, Henry
On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen < henrik.s.johansen@veloxit.no> wrote:
On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <marianopeck@gmail.com> wrote:
As far as I know, that's not possible in Pharo unless you explicitly register the desired objects in "WeakRegistry default" or similar (and implement #finalize). I think is the closest you have.
Cheers,
A few clarifications: - You can use a non-default WeakRegistry (usually one specific to your domain, to avoid cluttering of the default one) - You can specify a custom executor (any object which implements #finalize), rather than implement #finalize on objects you're interested in.
obj := Object new. executor := ObjectFinalizer receiver: Transcript selector: #show: argument: 'Object GC''d!'. myReg := WeakRegistry new. myReg add: obj executor: executor. obj := nil. Smalltalk garbageCollect.
Nice!!! I never tried with a different executor nor other instance of WeakRegistry. That's cool. Thanks Henry.
Cheers, Henry
-- Mariano http://marianopeck.wordpress.com
On 31 July 2013 15:14, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <marianopeck@gmail.com> wrote:
As far as I know, that's not possible in Pharo unless you explicitly register the desired objects in "WeakRegistry default" or similar (and implement #finalize). I think is the closest you have.
Cheers,
A few clarifications: - You can use a non-default WeakRegistry (usually one specific to your domain, to avoid cluttering of the default one) - You can specify a custom executor (any object which implements #finalize), rather than implement #finalize on objects you're interested in.
obj := Object new. executor := ObjectFinalizer receiver: Transcript selector: #show: argument: 'Object GC''d!'. myReg := WeakRegistry new. myReg add: obj executor: executor. obj := nil. Smalltalk garbageCollect.
Nice!!! I never tried with a different executor nor other instance of WeakRegistry. That's cool. Thanks Henry.
Really? Can't believe it! You? One who implemented Marea? :) -- Best regards, Igor Stasenko.
On 31 Jul 2013, at 16:59, Igor Stasenko <siguctua@gmail.com> wrote:
On 31 July 2013 15:14, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <marianopeck@gmail.com> wrote:
As far as I know, that's not possible in Pharo unless you explicitly register the desired objects in "WeakRegistry default" or similar (and implement #finalize). I think is the closest you have.
Cheers,
A few clarifications: - You can use a non-default WeakRegistry (usually one specific to your domain, to avoid cluttering of the default one) - You can specify a custom executor (any object which implements #finalize), rather than implement #finalize on objects you're interested in.
obj := Object new. executor := ObjectFinalizer receiver: Transcript selector: #show: argument: 'Object GC''d!'. myReg := WeakRegistry new. myReg add: obj executor: executor. obj := nil. Smalltalk garbageCollect.
Nice!!! I never tried with a different executor nor other instance of WeakRegistry. That's cool. Thanks Henry.
Really? Can't believe it! You? One who implemented Marea? :)
Yeah, incredible. And now he is even storing 200Mb of data is his images without knowing it ;-)
-- Best regards, Igor Stasenko.
On 31 July 2013 17:02, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 31 Jul 2013, at 16:59, Igor Stasenko <siguctua@gmail.com> wrote:
On 31 July 2013 15:14, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <marianopeck@gmail.com> wrote:
As far as I know, that's not possible in Pharo unless you explicitly register the desired objects in "WeakRegistry default" or similar (and implement #finalize). I think is the closest you have.
Cheers,
A few clarifications: - You can use a non-default WeakRegistry (usually one specific to your domain, to avoid cluttering of the default one) - You can specify a custom executor (any object which implements #finalize), rather than implement #finalize on objects you're interested in.
obj := Object new. executor := ObjectFinalizer receiver: Transcript selector: #show: argument: 'Object GC''d!'. myReg := WeakRegistry new. myReg add: obj executor: executor. obj := nil. Smalltalk garbageCollect.
Nice!!! I never tried with a different executor nor other instance of WeakRegistry. That's cool. Thanks Henry.
Really? Can't believe it! You? One who implemented Marea? :)
Yeah, incredible. And now he is even storing 200Mb of data is his images without knowing it ;-)
well, to be honest, that something different.. when you load the code which not written by you, which explodes your image size. -- Best regards, Igor Stasenko.
On 31 Jul 2013, at 17:06, Igor Stasenko <siguctua@gmail.com> wrote:
On 31 July 2013 17:02, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 31 Jul 2013, at 16:59, Igor Stasenko <siguctua@gmail.com> wrote:
On 31 July 2013 15:14, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen <henrik.s.johansen@veloxit.no> wrote:
On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <marianopeck@gmail.com> wrote:
As far as I know, that's not possible in Pharo unless you explicitly register the desired objects in "WeakRegistry default" or similar (and implement #finalize). I think is the closest you have.
Cheers,
A few clarifications: - You can use a non-default WeakRegistry (usually one specific to your domain, to avoid cluttering of the default one) - You can specify a custom executor (any object which implements #finalize), rather than implement #finalize on objects you're interested in.
obj := Object new. executor := ObjectFinalizer receiver: Transcript selector: #show: argument: 'Object GC''d!'. myReg := WeakRegistry new. myReg add: obj executor: executor. obj := nil. Smalltalk garbageCollect.
Nice!!! I never tried with a different executor nor other instance of WeakRegistry. That's cool. Thanks Henry.
Really? Can't believe it! You? One who implemented Marea? :)
Yeah, incredible. And now he is even storing 200Mb of data is his images without knowing it ;-)
well, to be honest, that something different.. when you load the code which not written by you, which explodes your image size.
Yes I know, I was just teasing. Let's hope we find the culprit soon.
-- Best regards, Igor Stasenko.
participants (7)
-
Alejandro Infante -
Clément Bera -
Esteban Lorenzano -
Henrik Johansen -
Igor Stasenko -
Mariano Martinez Peck -
Sven Van Caekenberghe