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

ArchiveApiTypeContainer retains references to FileSystem forever #837

Closed
laeubi opened this issue Oct 29, 2023 · 4 comments
Closed

ArchiveApiTypeContainer retains references to FileSystem forever #837

laeubi opened this issue Oct 29, 2023 · 4 comments

Comments

@laeubi
Copy link
Contributor

laeubi commented Oct 29, 2023

org.eclipse.pde.api.tools.internal.model.ArchiveApiTypeContainer has a static field JRTS, this currently prevents them from being garbage collected.

@iloveeclipse as JDT is also suing the FileSystem, is this the right pattern to use it?
@vik-chand why do we need special handling here and can't use JDT as in the else clause?

@merks
Copy link
Contributor

merks commented Oct 29, 2023

It looks like JDT has a map that keeps wrappers (org.eclipse.jdt.internal.compiler.util.JrtFileSystem) around them around forever too, i.e., org.eclipse.jdt.internal.compiler.util.JRTUtil.getJrtSystem(File, String) uses org.eclipse.jdt.internal.compiler.util.JRTUtil.images which is static.

@laeubi
Copy link
Contributor Author

laeubi commented Oct 29, 2023

@merks see

but I already clear that map, still then ApiTools has references to the file system I try to find out why currently even if I shutdown the framework the classloaders are not reclaimed, and suspect that here is a cyclic reference inside a "system object", maybe it is not the root cause but I see these references to pile-up after some runs.

@HannesWell
Copy link
Member

HannesWell commented Oct 29, 2023

It looks indeed very similar to what's already done in JDT.
Maybe even eclipse-jdt/eclipse.jdt.debug#294 could be generalized a bit more to also cover the cases of the API-tools here?

I havn't checked it in full detail, but some caller paths again lead to a IVMInstall (in a convoluted way). So maybe if this is restructured a bit, the JDT API to be can be used here directly.

@HannesWell
Copy link
Member

The own cache in PDE has been removed with #1359.
So I think we can consider this done (at least at PDE side).

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

No branches or pull requests

3 participants