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

NoopCleanUpsAction causes memory leak #205

Closed
ghost opened this issue Oct 24, 2016 · 0 comments
Closed

NoopCleanUpsAction causes memory leak #205

ghost opened this issue Oct 24, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Oct 24, 2016

We investigating using the groovy eclipse plugin in a headless eclipse setup for computing code-completion hints and error messages. To test this, we reloaded a groovy file + requested code completion approximately 1700 times and discovered a memory leak.

The head-dump:
headdump2

We see that we have in the InstancePreferences object a ListenerList which a size approximately equal to the number of our requests.
There we have NoopCleanUpsAction objects which have an EditorSite attached. We think that this NoopCleanUpsAction objects are created in the GroovyEditor class at line 817-823:

AllCleanUpsAction acua = (AllCleanUpsAction) ReflectionUtils.getPrivateField(GenerateActionGroup.class, "fCleanUp", group);
// GRECLIPSE-966 must dispose action to avoid memory leak
if (acua != null) {
acua.dispose();
ReflectionUtils.setPrivateField(CleanUpAction.class, "fEditor", acua, null);
}
ReflectionUtils.setPrivateField(GenerateActionGroup.class, "fCleanUp", group, new NoopCleanUpsAction(getEditorSite()));

We cannot find GRECLIPSE-966 so we do not understand why line 817-822 is necessary and so we do not know what exactly the need for NoopCleanUpsAction is..., but in line 823 the NoopCleanUpsAction object gets created and we think that this is the origin of the memory leak.

(Our guess is: in NoopCleanUpsAction the dispose function gets overridden without calling super.dispose() ==> this could already be a fix?)

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

No branches or pull requests

1 participant