Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug : Some component instances are still existing in the image after a cleanUp. #59

Closed
Samuel29590 opened this issue May 18, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@Samuel29590
Copy link
Contributor

When you start a system with Molecule and then you stop this system, there are some times some component instances that are still existing in the image.
They are visible by looking in the Inspect all component instances menu of Molecule after an execution of a Molecule system.

issues

To reproduce

Lunch the GPS example, wait a little, and stop the example.

MolGPSExampleLauncher start.
"wait a little"
MolGPSExampleLauncher stop.

Then go on the Inspect all component instances menu of Molecule.
And here are the lost instances.

Fix

A solution to solve this problem is to do a garbage before opening this menu.

Smalltalk garbageCollect.

By doing that lost instances are remove from the Pharo image, and so they aren't visible from this menu. Furthermore, doing a garbage don't influence instances that are alive or using by a system, so this solution don't influence the menu's function.

@labordep
Copy link
Member

Thanks Samuel.
Note : that's not a bug, the cleanUp clean only the current session of the ComponentManager (and also itself).
Some objects instances are not yet clean by the garbage collector, due to Smalltalk environement mecanism, I don't know when it's do but probably follwing a garbage cleanup policie. This is a new feature that consist to force the garbaging of stopped components when the ComponentManager>>cleanUp is done (for example).

@labordep labordep added the enhancement New feature or request label May 21, 2022
@labordep
Copy link
Member

I think this is better to do the garbageCollector by the ComponentManager, I think by the UI (on the menu) this is not the good place. UI need to show us a real state of the Component system and interferate the less (this is just a view). If there is some lost instances we need to clean that by a controller (I suggest the componentmanager) but not by calling only a UI function.

So, what do you think about grab the cleanup part of MolComponentManager>>flashComponents and to do the same thing at the end of the MolComponentManager>>cleanUp ? With that when you clean the system all stopped components will be automatically removed.

@Samuel29590
Copy link
Contributor Author

Yes it's probably a better solution to do the garbage collector after cleanUp, than before opening the UI.
It will permit to cleanUp instances that are lost with the others, and that's better !

Your solution is good and better. So, let's go for that ?

@labordep
Copy link
Member

Ok !
You can move your code from the UI to the MolComponentManager, and execute related unit-tests to confirm the patch :-)

labordep added a commit that referenced this issue Jul 12, 2022
labordep added a commit that referenced this issue Jul 12, 2022
… but in the inspect all components list. Add a garbage collect anyway when the Pharo system is cleanUp in the deepCleanUp method of the component manager + TU.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants