pharo-contributions / taskit

TaskIt is a library that ease Process usage in Pharo. It provides abstractions to execute and synchronize concurrent tasks, and several pre-built mechanisms that are useful for many application developers.
MIT License
43 stars 24 forks source link

Strange memory leak #8

Closed sbragagnolo closed 8 years ago

sbragagnolo commented 8 years ago

TKTWorker's are leaking. The only reference is weak finalizer item.

Execute tests, and after.

Smalltalk garbageCollect. (TKTWorker allInstances reject: #isRunning) size > 1 Smalltalk tools pointerExplorer openOn: (TKTWorker allInstances reject: #isRunning) first.

It happens the same with every other

sbragagnolo commented 8 years ago

Probably is related with the fact that the worker is the executor of the finalize. Probably we are registering the worker as finalizer and not a shallow copy

guillep commented 8 years ago

Well in my latest tests it takes time to collect, but it gets collected eventually. Because you need to give time to the gc to run and to the finalization process to execute and finalize.

Anyways, I'll test it again...

guillep commented 8 years ago

I have no leaking workers after running the tests in latest version.

However, be careful! I changed the WorkerPool implementation in a recent commit, so the global workerpool should be reset. I am about to implement a TKTWorkerPool>>resetGlobal to do that.

guillep commented 8 years ago

Santi, can you try with a new image? I'd close the issue if you cannot reproduce it with a new image from dev-0.2.

sbragagnolo commented 8 years ago

Let me pull dev0.2 and ill do it :)

sbragagnolo commented 8 years ago

Re checked with browser and there is no leak :)