Skip to content
Snippets Groups Projects
Commit 00defd6b authored by Junjun2016's avatar Junjun2016 Committed by GitHub
Browse files

update resource limit (#700)

parent 259eeb08
No related branches found
No related tags found
No related merge requests found
......@@ -14,8 +14,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))
DATASETS = Registry('dataset')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment