Skip to content
Snippets Groups Projects
Unverified Commit 5276dfb4 authored by Wenhao Wu's avatar Wenhao Wu Committed by GitHub
Browse files

[Enhance] Modify resourse limit (#796)

parent a56185ab
No related branches found
No related tags found
No related merge requests found
......@@ -8,8 +8,9 @@ if platform.system() != 'Windows':
# https://github.com/pytorch/pytorch/issues/973
import resource
rlimit = resource.getrlimit(resource.RLIMIT_NOFILE)
base_soft_limit = rlimit[0]
hard_limit = rlimit[1]
soft_limit = min(4096, hard_limit)
soft_limit = min(max(4096, base_soft_limit), hard_limit)
resource.setrlimit(resource.RLIMIT_NOFILE, (soft_limit, hard_limit))
OBJECTSAMPLERS = Registry('Object sampler')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment