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

Logging to file leads to too many open files #9

Open
essenciary opened this issue Aug 28, 2019 · 1 comment
Open

Logging to file leads to too many open files #9

essenciary opened this issue Aug 28, 2019 · 1 comment

Comments

@essenciary
Copy link

I might be using it wrong, but logging a lot eventually runs out of files. It seems that opened files never get closed: f = open(file_name, file_mode)

┌ Error: SystemError: opening file "log/dev.log": Too many open files
│ #systemerror#44(::Nothing, ::typeof(systemerror), ::String, ::Bool) at /Applications/Julia-1.2.app/Contents/Resources/julia/lib/julia/sys.dylib:?
│ systemerror at ./error.jl:134 [inlined]
│ #open#311(::Nothing, ::Nothing, ::Nothing, ::Nothing, ::Bool, ::typeof(open), ::String) at ./iostream.jl:289#open at ./none:0 [inlined]open(::String, ::String) at ./iostream.jl:345#basic_config#2 at /Users/adrian/.julia/packages/MiniLogging/F3GsD/src/MiniLogging.jl:123 [inlined]
│ basic_config at /Users/adrian/.julia/packages/MiniLogging/F3GsD/src/MiniLogging.jl:122 [inlined]
@essenciary
Copy link
Author

It was me calling basic_config multiple times. However, would it be possible to close the file pointers when the variables get garbage collected?

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

No branches or pull requests

1 participant