GithubHelp home page GithubHelp logo

Comments (9)

svilenvul avatar svilenvul commented on June 2, 2024 1

@svilenvul let me confirm: are your Maven uses -T option, to run modules in parallel?

No, currently it is not being used.

from spotbugs-maven-plugin.

KengoTODA avatar KengoTODA commented on June 2, 2024

note from my investigation:

  • ICodeBase,IClassPath is AutoCloseable.
  • IClassPath is responsible to close all ICodeBase instances inside it
  • FindBugs2#clearCaches() closes generated IClassPath
  • It seems that this plugin doesn't invoke FindBugs2#clearCaches() for now

So I guess that we should invoke this FindBugs2#clearCaches() method, or create classloader to GC FindBugs2.classpath that is singleton field?

I will test following patch later.

diff --git a/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs2.java b/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs2.java
index dc061d2a8..1be3e9691 100644
--- a/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs2.java
+++ b/spotbugs/src/main/java/edu/umd/cs/findbugs/FindBugs2.java
@@ -1185,7 +1185,7 @@ public class FindBugs2 implements IFindBugsEngine {
 
 
         FindBugs.runMain(findBugs, commandLine);
-
+        findBugs.clearCaches();
     }

UPDATE

  • findBugs.clearCaches() are already invoked in FindBugs2#execute() which is called by FindBugs#runMain(...).

from spotbugs-maven-plugin.

KengoTODA avatar KengoTODA commented on June 2, 2024

spotbugs/spotbugs#589 is similar with this issue, but this issue's target is mainly jar files in classpath to scan.

from spotbugs-maven-plugin.

KengoTODA avatar KengoTODA commented on June 2, 2024

@svilenvul let me confirm: are your Maven uses -T option, to run modules in parallel?

from spotbugs-maven-plugin.

KengoTODA avatar KengoTODA commented on June 2, 2024

WIP: https://github.com/spotbugs/spotbugs/compare/fix-resource-leaks

from spotbugs-maven-plugin.

KengoTODA avatar KengoTODA commented on June 2, 2024

We started investigating the problem and found out that there is a huge number of opened files (spotbugs plugins).

Almost all opened file isn't not spotbugs plugin, but libraries in aux classpath.

In current architecture, spotbugs keeps all jar files opened during analysis (because IClassPath is keep opened), so we should face problem like this. To fix this issue, I think we need to change internal architecture to handle libraries in aux & app classpaths as stream.

from spotbugs-maven-plugin.

famod avatar famod commented on June 2, 2024

Has there been any progress? We are now seeing this frequently on our Jenkins CI server (we are using -T and there can also be concurrent builds).

from spotbugs-maven-plugin.

hazendaz avatar hazendaz commented on June 2, 2024

This issue is likely related to #535 that has existed in this code base since its original inception with findbugs. Has to do with the -T and it getting locks as system.in was being called. This is to be removed in upcoming release 4.7.3.1 within the week.

from spotbugs-maven-plugin.

hazendaz avatar hazendaz commented on June 2, 2024

closing as believe fixed with 4.7.3.1. If still an issue, please open a new ticket based off current data.

from spotbugs-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.