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

The resource leak checker is taking a substantial amount of time on some NJR-1 projects. #6430

Closed
iamsanjaymalakar opened this issue Jan 30, 2024 · 3 comments
Assignees

Comments

@iamsanjaymalakar
Copy link
Member

iamsanjaymalakar commented Jan 30, 2024

I was running RLC on the benchmark projects of the NJR-1 dataset. It contains 293 java projects. Among them, two projects took more than an hour and still didn't finish running the RLC.

Input

The NJR-1 dataset which is available at https://zenodo.org/records/4839913. Download the njr-1_dataset.zip file and extract it, where you will find all the projects.

The two projects that took an unsual amount of time are:

  • url7a45f192ca_mfullen_ping_pong_net_tgz-pJ8-ping_pong_net_client_io_TestClientNonPPNServerJ8, 8226.978153467178s, 6013 LoC
  • url86119f019a_solzy_hive_parse_tgz-pJ8-org_apache_hadoop_hive_ql_parse_MainJ8, 1000.8362658023834s, 53496 LoC
    Here's the full list of the time taken by each project in the NJR-1 dataset (sorted desc on the timing, the timings are in seconds):
    checkerframework_timings.csv

JDK: Java 8

Commands

I invoked the CF using the Javac. Here's the abstracted command:

CF_BINARY = "../tools/checker-framework-3.42.0/checker/bin/javac"
CF_COMMAND = "-processor org.checkerframework.checker.resourceleak.ResourceLeakChecker -Adetailedmsgtext"
COMPILED_CLASSES_FOLDER="/ANY/FOLDER/TO/BE/USED/BY/CF"
lib_folder = "/THE/'lib'/FOLDER/INSIDE/EACH/BENCHMARK/PROJECT/WHICH/IS/PREBUILT/"
SRC_FILES="/A/TXT/FILE/CONTAINING/ALL/THE/JAVA/FILES/OF/THE/PROJECT/"
command = (CF_BINARY
        + " " + CF_COMMAND
        + " " + "-J-Xmx8G"
        + " " + "-d"
        + " " + COMPILED_CLASSES_FOLDER
        + " -cp " + lib_folder
        + " @" + SRC_FILES"
    )

Output

Here's a screenshot of the timing of the two projects.
image

Expectation

The expected behavoir is that it should not take one hour to run a project with only 6K LoC.

@msridhar
Copy link
Contributor

Thanks @iamsanjaymalakar. The first case is an infinite loop. I've opened #6433 for that one. Once we figure that one out I'll look at the second case.

@msridhar
Copy link
Contributor

I've also opened an issue for the second case, #6435

@msridhar
Copy link
Contributor

msridhar commented Feb 8, 2024

As #6433 is fixed I'm going to close this in favor of #6435 which covers the remaining issue

@msridhar msridhar closed this as completed Feb 8, 2024
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

2 participants