SystemError: Too many open files
when running ipopt
in a loop
#100
Labels
bug
Something isn't working
SystemError: Too many open files
when running ipopt
in a loop
#100
TL;DR: I get the following error when I run
ipopt
multiple times in a loop:According to the error message, this line is the problem:
NLPModelsIpopt.jl/src/NLPModelsIpopt.jl
Line 242 in 1a16af5
I feel like
ipopt_log_file
is never closed because I don't see where it's closed or deleted in the code.Code
This is a Pluto notebook, but it can be run like a regular Julia script. The below error happens when this code is run from Pluto too.
Error
Steps to reproduce
julia-1.8 -i notebook.jl
to run the full codew = let nrep = 200 ...
) manually several times in quick succession.Running
lsof
shows that thejulia
process has a lot of open filesBefore running the
w = let ...
code (Julia REPL is running):The
julia
process has too few open files to be shown here. The left column is the number of files, the rightmost column is the Process ID.After running
w = let ...
once:Now
julia
has 280 open files! After running the piece of code one more time and getting theToo many open files
error:Now
julia
has 313 open files, and I can't run even a single iteration of the loop in the code.Several minutes later, the output of
lsof
doesn't containjulia
anymore, and I can run my code a couple of times until the inevitableSystemError: Too many open files
.Versions
The text was updated successfully, but these errors were encountered: