{"action":"closed","issue":{"url":"https://api.github.com/repos/JuliaLang/julia/issues/12521","labels_url":"https://api.github.com/repos/JuliaLang/julia/issues/12521/labels{/name}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/12521/comments","events_url":"https://api.github.com/repos/JuliaLang/julia/issues/12521/events","html_url":"https://github.com/JuliaLang/julia/issues/12521","id":99831093,"number":12521,"title":"Creating many SharedArrays across multiple workers results in shm_open() failure: Too many open files","user":{"login":"JohnHBrock","id":3038603,"avatar_url":"https://avatars.githubusercontent.com/u/3038603?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnHBrock","html_url":"https://github.com/JohnHBrock","followers_url":"https://api.github.com/users/JohnHBrock/followers","following_url":"https://api.github.com/users/JohnHBrock/following{/other_user}","gists_url":"https://api.github.com/users/JohnHBrock/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnHBrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnHBrock/subscriptions","organizations_url":"https://api.github.com/users/JohnHBrock/orgs","repos_url":"https://api.github.com/users/JohnHBrock/repos","events_url":"https://api.github.com/users/JohnHBrock/events{/privacy}","received_events_url":"https://api.github.com/users/JohnHBrock/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-08T20:01:17Z","updated_at":"2015-08-11T11:28:50Z","closed_at":"2015-08-11T11:28:50Z","body":"When using multiple workers to create many SharedArrays, I get a \"Too many open files\" error. Running the code with `julia test_code.jl` instead of `julia -p 4 test_code.jl` seems to get rid of the error.\r\n\r\nversioninfo():\r\n```\r\nJulia Version 0.3.11\r\nCommit 483dbf5 (2015-07-27 06:18 UTC)\r\nPlatform Info:\r\n  System: Linux (x86_64-amazon-linux)\r\n  CPU: Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz\r\n  WORD_SIZE: 64\r\n  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)\r\n  LAPACK: libopenblas\r\n  LIBM: libopenlibm\r\n  LLVM: libLLVM-3.3\r\n```\r\n\r\n\r\nExample code:\r\n```Julia\r\nfunction doStuff()\r\n  container = SharedArray{Int64,1}[]\r\n  resize!(container, 1024)\r\n  @sync @parallel for i=1:1024\r\n    container[i] = convert(SharedArray,rand(Int64, 10))\r\n  end\r\nend\r\n\r\ndoStuff()\r\n```\r\n\r\nSample execution:\r\n```\r\n$ julia -p 4 test_code.jl\r\nexception on 2: exception on ERROR: shm_open() failed for /jl618081439062831622710016: Too many open files\r\n in _jl_spawn at process.jl:217\r\n in spawn at process.jl:348\r\n in open at /home/jbrock/julia3/usr/bin/../lib/julia/sys.so\r\n in readbytes at /home/jbrock/julia3/usr/bin/../lib/julia/sys.so\r\n in print_shmem_limits at sharedarray.jl:319\r\n in shm_mmap_array at sharedarray.jl:346\r\n in anonymous at sharedarray.jl:58\r\n in anonymous at multi.jl:848\r\n in run_work_thunk at multi.jl:621\r\n in run_work_thunk at multi.jl:630\r\n in anonymous at task.jl:6\r\n2: exception on exception on ERROR: shm_open() failed for /jl618101439062831622867200: Too many open files\r\n in _jl_spawn at process.jl:217\r\n in spawn at process.jl:348\r\n in open at /home/jbrock/julia3/usr/bin/../lib/julia/sys.so\r\n in readbytes at /home/jbrock/julia3/usr/bin/../lib/julia/sys.so\r\n in print_shmem_limits at sharedarray.jl:319\r\n in shm_mmap_array at sharedarray.jl:346\r\n in anonymous at sharedarray.jl:58\r\n in anonymous at multi.jl:848\r\n in run_work_thunk at multi.jl:621\r\n in run_work_thunk at multi.jl:630\r\n in anonymous at task.jl:6\r\n22: : ERROR: shm_open() failed for /jl618091439062831796041984: Too many open files\r\n in _jl_spawn at process.jl:217\r\n in spawn at process.jl:348\r\n in open at /home/jbrock/julia3/usr/bin/../lib/julia/sys.so\r\n in readbytes at /home/jbrock/julia3/usr/bin/../lib/julia/sys.so\r\n in print_shmem_limits at sharedarray.jl:319\r\n in shm_mmap_array at sharedarray.jl:346\r\n in anonymous at sharedarray.jl:58\r\n in anonymous at multi.jl:848\r\n in run_work_thunk at multi.jl:621\r\n in run_work_thunk at multi.jl:630\r\n in anonymous at task.jl:6\r\n\r\n(etc.)\r\n```"}}