jump-dev / HiGHS.jl

A Julia interface to the HiGHS solver
https://highs.dev
MIT License
103 stars 14 forks source link

HiGHS File Handle Leak #79

Closed josephmckinsey closed 2 years ago

josephmckinsey commented 2 years ago

Running JuMP.optimize many times will cause the julia process to run out of file handles. Running lsof shows that Highs.log is opened many times and never closed.

The easiest way to reproduce is to try optimizing many times with julia --project -i and then either it will fail or lsof will show hundreds of Highs.log files opened.

using HiGHS
using JuMP

function run_once()
    vector_model = Model(HiGHS.Optimizer)

    A = [
        1 1 9 5
        3 5 0 8
        2 0 6 13
    ]

    b = [7; 3; 5]

    c = [1; 3; 5; 2]

    @variable(vector_model, x[1:4] >= 0)
    @constraint(vector_model, A * x .== b)
    @objective(vector_model, Min, c' * x)

    @timed JuMP.optimize!(vector_model)
end

for i in 1:1000
    run_once()
end

I've been testing against HiGHS version 0.3.10 and HiGHS_jll version 1.1.1+0. JuMP version is 0.22.2.

odow commented 2 years ago

This was an upstream bug in HiGHS: https://github.com/ERGO-Code/HiGHS/issues/586. It will be resolved in the next upstream release of HiGHS.