-
Notifications
You must be signed in to change notification settings - Fork 314
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
Check if bundle contexes correctly unget services after invoking getService #253
Comments
@LucaDazi do you remember what was the conclusion? |
Yes #530 is exactly that. Beside violating the spec 😉 … Looking at Equinox's implementation this can happen:
Now MAX_VALUE is quite a number, but running for some time, constantly getting called, you eventually reach it. For ServiceFactory objects, they won't get garbage collected. You probably won't run into any memory leaks, since everything seems to be reference counted. But then again, cleaning up afterwards and following the spec seems like the right thing to do. |
@ctron are you willing to find and fix all the unbalanced occurrences for Kura 3.0? |
Not really. |
@nicolatimeus can you please find all occurrences of these unbalanced calls and provide a list of the unbalanced calls for estimating the effort? |
The table below reports the the invocations to The The table below report the number of call sites for each method according to Eclipse:
The table below reports the details about
|
There's some duplication in [1] and [2]. @ctron @amitjoy wouldn't be better to collapse everything in the org.eclipse.kura.util bundle? [1] https://github.com/eclipse/kura/blob/develop/kura/org.eclipse.kura.util/src/main/java/org/eclipse/kura/util/service/ServiceUtil.java |
@cdealti I second that 👍 |
Sure, go ahead. |
@amitjoy are you willing to do that ;-)? |
Just had a quick look on the findings and I agree that in OSGi, the low-level methods can easily be misused by any developer and that's why we had a long discussion in #797. To cope up with the requirement of providing an easy to use helper class, I have designed an utility class in #1303. If it gets merged, we can refactor the aforementioned classes accordingly. I would be happy to do that. |
This issue is stale because it has been open for 60 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Several OSGi Services are acquired using the bundle context.
After the services are no more needed they should be released calling ungetService(...) in order to keep the reference count of said services consistant.
The text was updated successfully, but these errors were encountered: