Memory leaks

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Memory leaks

abergel
Hi!

It looks like that we are currently suffering memory leaks.
In march 2015 it was said in the mailing list:

-=-=-=-=-=-=-=-=
I also tried this:

1. Create a dummy class:
Object subclass: #AAA
        instanceVariableNames: 'x'
        classVariableNames: ''
        category: 'AAA'.
       
2. Open a Playground and do it and go on this:
a := #AAA asClass new.

3. In the second pane go on "self"

4. Close the Playground

5. Execute:
3 timesRepeat: [ Smalltalk garbageCollect ].

6. Check:
#AAA asClass allInstances.

7. Repeat if necessary, and after a while, the result after step 6 is not empty.
-=-=-=-=-=-=-=-=

The problem is still present.
Looking at the pointers

There was an object reference crawler no? I remember someone worked on this? I tried sending #pointersTo but I without much success on identifying the cause of this leak.

Any idea?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-dev] Memory leaks

Sven Van Caekenberghe-2

> On 30 Jan 2017, at 22:57, Alexandre Bergel <[hidden email]> wrote:
>
> Hi!
>
> It looks like that we are currently suffering memory leaks.

That is a bit strong a statement.
Maybe some IDE UI stuff might sometimes hold onto something too long.

> In march 2015 it was said in the mailing list:
>
> -=-=-=-=-=-=-=-=
> I also tried this:
>
> 1. Create a dummy class:
> Object subclass: #AAA
> instanceVariableNames: 'x'
> classVariableNames: ''
> category: 'AAA'.
>
> 2. Open a Playground and do it and go on this:
> a := #AAA asClass new.

And why would you do that ?

You assign to a workspace variable, hence your object is held in the scope of the Playground.

So whenever the Playground gets retained by some other object, like an announcement, event or whatever, your object get retained too.

I am 100% sure that if you do

1e6 timesRepeat: [ #AAA asClass new ].
3 timesRepeat: [ Smalltalk garbageCollect ].
#AAA asClass allInstances isEmpty.

=> true
 

> 3. In the second pane go on "self"
>
> 4. Close the Playground
>
> 5. Execute:
> 3 timesRepeat: [ Smalltalk garbageCollect ].
>
> 6. Check:
> #AAA asClass allInstances.
>
> 7. Repeat if necessary, and after a while, the result after step 6 is not empty.
> -=-=-=-=-=-=-=-=
>
> The problem is still present.
> Looking at the pointers
>
> There was an object reference crawler no? I remember someone worked on this? I tried sending #pointersTo but I without much success on identifying the cause of this leak.
>
> Any idea?
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Memory leaks

Ben Coman
In reply to this post by abergel
On Tue, Jan 31, 2017 at 5:57 AM, Alexandre Bergel
<[hidden email]> wrote:

> Hi!
>
> It looks like that we are currently suffering memory leaks.
> In march 2015 it was said in the mailing list:
>
> -=-=-=-=-=-=-=-=
> I also tried this:
>
> 1. Create a dummy class:
> Object subclass: #AAA
>         instanceVariableNames: 'x'
>         classVariableNames: ''
>         category: 'AAA'.
>
> 2. Open a Playground and do it and go on this:
> a := #AAA asClass new.
>
> 3. In the second pane go on "self"
>
> 4. Close the Playground
>
> 5. Execute:
> 3 timesRepeat: [ Smalltalk garbageCollect ].
>
> 6. Check:
> #AAA asClass allInstances.
>
> 7. Repeat if necessary, and after a while, the result after step 6 is not empty.
> -=-=-=-=-=-=-=-=
>
> The problem is still present.
> Looking at the pointers
>
> There was an object reference crawler no? I remember someone worked on this? I tried sending #pointersTo but I without much success on identifying the cause of this leak.

I did PointerDetective.
http://www.smalltalkhub.com/#!/~BenComan/PointerDetective

It still needs a bit of polishing but it fell off my list.  The latest
is not stable.  You probably want commit 7 or 8.
http://www.smalltalkhub.com/#!/~BenComan/PointerDetective/commits

cheers -ben
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Memory leaks

Pavel Krivanek-3
In reply to this post by abergel
Last week I was hunting the memory leaks with RefsHunter because the abnormal amount of Point instances in the object memory. 

FreeTypeCache cleanUp.
Clipboard startUp: true.
RubEditingState allInstances do: [ :each | each instVarNamed: #undoManager put:nil].
GTPlayBook reset.
EditorFindReplaceDialogWindow cleanUp.
ActiveHand resetClickState; releaseAllFocus.
UITheme current focusIndicator: nil.
40 timesRepeat: [
1 second wait.
World doOneCycle.
]. 

I will try to find the reason why they appear, not only how to kill them.

Cheers,
-- Pavel

2017-01-30 22:57 GMT+01:00 Alexandre Bergel <[hidden email]>:
Hi!

It looks like that we are currently suffering memory leaks.
In march 2015 it was said in the mailing list:

-=-=-=-=-=-=-=-=
I also tried this:

1. Create a dummy class:
Object subclass: #AAA
        instanceVariableNames: 'x'
        classVariableNames: ''
        category: 'AAA'.

2. Open a Playground and do it and go on this:
a := #AAA asClass new.

3. In the second pane go on "self"

4. Close the Playground

5. Execute:
3 timesRepeat: [ Smalltalk garbageCollect ].

6. Check:
#AAA asClass allInstances.

7. Repeat if necessary, and after a while, the result after step 6 is not empty.
-=-=-=-=-=-=-=-=

The problem is still present.
Looking at the pointers

There was an object reference crawler no? I remember someone worked on this? I tried sending #pointersTo but I without much success on identifying the cause of this leak.

Any idea?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Memory leaks

abergel
Oh!

Thanks to John’s ReferenceFinder, I found the following incantation to clean the memory:

Clipboard startUp: true.
GTPlayBook reset.
RubEditingState allInstances do: [ :i | i undoManager reset. ].
CairoBackendCache soleInstance flush

I was looking for Roassal instances. Maybe that by regularly cleaning the memory the Athens/FFI bug will disappear

Cheers,
Alexandre

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jan 31, 2017, at 5:05 AM, Pavel Krivanek <[hidden email]> wrote:

Last week I was hunting the memory leaks with RefsHunter because the abnormal amount of Point instances in the object memory. 

FreeTypeCache cleanUp.
Clipboard startUp: true.
RubEditingState allInstances do: [ :each | each instVarNamed: #undoManager put:nil].
GTPlayBook reset.
EditorFindReplaceDialogWindow cleanUp.
ActiveHand resetClickState; releaseAllFocus.
UITheme current focusIndicator: nil.
40 timesRepeat: [
1 second wait.
World doOneCycle.
]. 

I will try to find the reason why they appear, not only how to kill them.

Cheers,
-- Pavel

2017-01-30 22:57 GMT+01:00 Alexandre Bergel <[hidden email]>:
Hi!

It looks like that we are currently suffering memory leaks.
In march 2015 it was said in the mailing list:

-=-=-=-=-=-=-=-=
I also tried this:

1. Create a dummy class:
Object subclass: #AAA
        instanceVariableNames: 'x'
        classVariableNames: ''
        category: 'AAA'.

2. Open a Playground and do it and go on this:
a := #AAA asClass new.

3. In the second pane go on "self"

4. Close the Playground

5. Execute:
3 timesRepeat: [ Smalltalk garbageCollect ].

6. Check:
#AAA asClass allInstances.

7. Repeat if necessary, and after a while, the result after step 6 is not empty.
-=-=-=-=-=-=-=-=

The problem is still present.
Looking at the pointers

There was an object reference crawler no? I remember someone worked on this? I tried sending #pointersTo but I without much success on identifying the cause of this leak.

Any idea?

Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.list.inf.unibe.ch/listinfo/moose-dev