Skip to content

Commit d8301f8

Browse files
authored
Merge pull request #57 from gpilab/develop
Bugfix for Windows memory allocation
2 parents 5910715 + 1fc24b9 commit d8301f8

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/gpi/sysspecs.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,14 @@ def findAndSetMaxOpenFilesLimit(self):
102102
import resource
103103
lim = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
104104
hard_lim = resource.getrlimit(resource.RLIMIT_NOFILE)[1]
105+
# if the hard limit is infinite (unlimited resources) cap it at 10000
106+
if hard_lim == resource.RLIM_INFINITY:
107+
lim = 10000
108+
hard_lim = 10000
105109
else:
106110
lim = 10000
107111
hard_lim = 10000
108112

109-
# if the hard limit is infinite (unlimited resources) cap it at 10000
110-
if hard_lim == resource.RLIM_INFINITY:
111-
lim = 10000
112-
hard_lim = 10000
113-
114113
while (not self._inWindows) and (not maxFound):
115114
try:
116115
lim += 10

0 commit comments

Comments
 (0)