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

Libraries' JARs cannot be deleted after Maracas computes Delta #72

Open
KarinaMankevic opened this issue Jul 6, 2022 · 0 comments
Open

Comments

@KarinaMankevic
Copy link

KarinaMankevic commented Jul 6, 2022

I noticed that I cannot delete files during program execution after they have been analyzed by Maracas. I ran different tests to understand at which point I cannot delete files. Turns out, deletion of files is no longer possible right after Maracas computes Delta with the following method call:
Delta delta = Maracas.computeDelta(apiPath1, apiPath2)

This is a problem because I analyze big dataset and after running 1.6% of my data I already accumulate 6GB of local data (that cannot be deleted during program execution), and besides, I run out of memory due to filled up Java Heap Space. Perhaps, this has to do with resources not being released completely, and some references are still stored on the heap (my best guess).

We experimented with @lmove further with the test I have in my project. The test is called testFilesCanBeDeletedAfterMaracasAnalysis, and it is pushed to my project repo, in MaracasAnalyzerTest.java file. We found out that the problem is caused by the following method invocation (internal to Maracas tool):
Delta delta = Delta.fromJApiCmpDelta( api1Path.toAbsolutePath(), api2Path.toAbsolutePath(), classes, MaracasOptions.newDefault());
By debugging further, Lina reached a conclusion that it is worth taking a closer look at buildSpoonModel method that is called somewhere downstream Maracas, which might be opening the files, but not releasing them, causing the issue.

tdegueul added a commit that referenced this issue Aug 25, 2022
  - Keep the JARs open in the URLClassLoader until we're done with
    building our delta model
  - Then, explicitly cl.close() it when appropriate (???) to release the
    JARs
@tdegueul tdegueul linked a pull request Aug 25, 2022 that will close this issue
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