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 <[hidden email]>
|
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 <[hidden email]> wrote:
|
In reply to this post by 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 <[hidden email]> wrote:
Mariano http://marianopeck.wordpress.com |
On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <[hidden email]> 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 <[hidden email]> wrote:
Nice!!! I never tried with a different executor nor other instance of WeakRegistry. That's cool. Thanks Henry. Cheers, Mariano http://marianopeck.wordpress.com |
On 31 July 2013 15:14, Mariano Martinez Peck <[hidden email]> wrote:
> > > > On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen > <[hidden email]> wrote: >> >> >> On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <[hidden email]> >> 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 <[hidden email]> wrote: > On 31 July 2013 15:14, Mariano Martinez Peck <[hidden email]> wrote: >> >> >> >> On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen >> <[hidden email]> wrote: >>> >>> >>> On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <[hidden email]> >>> 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 <[hidden email]> wrote:
> > On 31 Jul 2013, at 16:59, Igor Stasenko <[hidden email]> wrote: > >> On 31 July 2013 15:14, Mariano Martinez Peck <[hidden email]> wrote: >>> >>> >>> >>> On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen >>> <[hidden email]> wrote: >>>> >>>> >>>> On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <[hidden email]> >>>> 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 <[hidden email]> wrote: > On 31 July 2013 17:02, Sven Van Caekenberghe <[hidden email]> wrote: >> >> On 31 Jul 2013, at 16:59, Igor Stasenko <[hidden email]> wrote: >> >>> On 31 July 2013 15:14, Mariano Martinez Peck <[hidden email]> wrote: >>>> >>>> >>>> >>>> On Wed, Jul 31, 2013 at 6:31 AM, Henrik Johansen >>>> <[hidden email]> wrote: >>>>> >>>>> >>>>> On Jul 31, 2013, at 3:23 , Mariano Martinez Peck <[hidden email]> >>>>> 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. > |
Free forum by Nabble | Edit this page |