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

TargetDefinition leak #1246

Closed
basilevs opened this issue Apr 22, 2024 · 0 comments · Fixed by #1247
Closed

TargetDefinition leak #1246

basilevs opened this issue Apr 22, 2024 · 0 comments · Fixed by #1247

Comments

@basilevs
Copy link
Contributor

While investigating a potential memory leak in RCPTT I've discovered that
org.eclipse.pde.internal.core.target.TargetPlatformService.deleteTarget(ITargetHandle) does not clean up org.eclipse.pde.internal.core.TargetPlatformHelper.fgCachedTargetDefinitionMap.

Moreover I could not find an API that performs cleanup of both TargetPlatformService and TargetPlatformHelper, so the workaround ought to be managing both explicitly on every deletion.

Suggested fix: make TargetPlatformService.deleteTarget() cleanup the TargetPlatformHelper cache.

basilevs added a commit to basilevs/eclipse.pde that referenced this issue Apr 22, 2024
TargetPlatformHelper and TargetPlatformService keep separate caches for
target definition, resulting in a leak of TargetDefinition objects.

The leak happens when TargetDefinition.resolve() caches data in
TargetPlatformHelper.

Fixes eclipse-pde#1246
HannesWell pushed a commit to basilevs/eclipse.pde that referenced this issue May 15, 2024
TargetPlatformHelper and TargetPlatformService keep separate caches for
target definition, resulting in a leak of TargetDefinition objects.

The leak happens when TargetDefinition.resolve() caches data in
TargetPlatformHelper.

Fixes eclipse-pde#1246
HannesWell pushed a commit to basilevs/eclipse.pde that referenced this issue May 18, 2024
TargetPlatformHelper and TargetPlatformService keep separate caches for
target definition, resulting in a leak of TargetDefinition objects.

The leak happens when TargetDefinition.resolve() caches data in
TargetPlatformHelper.

Fixes eclipse-pde#1246
HannesWell pushed a commit to basilevs/eclipse.pde that referenced this issue May 18, 2024
TargetPlatformHelper and TargetPlatformService keep separate caches for
target definition, resulting in a leak of TargetDefinition objects.

The leak happens when TargetDefinition.resolve() caches data in
TargetPlatformHelper.

This also allows to skip the explicit removal of a target selected for
removal from the TargetPlatformHelper's cache in
TargetPlatformPreferencePage.handleRemove() because the removal will
done when the change is applied and TargetPlatformService.deleteTarget()
is then called.

Fixes eclipse-pde#1246
HannesWell pushed a commit that referenced this issue May 18, 2024
TargetPlatformHelper and TargetPlatformService keep separate caches for
target definition, resulting in a leak of TargetDefinition objects.

The leak happens when TargetDefinition.resolve() caches data in
TargetPlatformHelper.

This also allows to skip the explicit removal of a target selected for
removal from the TargetPlatformHelper's cache in
TargetPlatformPreferencePage.handleRemove() because the removal will
done when the change is applied and TargetPlatformService.deleteTarget()
is then called.

Fixes #1246
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant