consult RLIMIT_AS instead of RLIMIT_DATA for OS-imposed memory limit
This commit is contained in:
parent
5e8e4c6ffc
commit
9e71ccc1eb
|
@ -10,11 +10,7 @@ static size_type determine_max_heap_size(void)
|
|||
{
|
||||
struct rlimit rlim;
|
||||
|
||||
# ifdef OS_X
|
||||
getrlimit(RLIMIT_RSS, &rlim);
|
||||
# else
|
||||
getrlimit(RLIMIT_DATA, &rlim);
|
||||
# endif
|
||||
getrlimit(RLIMIT_AS, &rlim);
|
||||
|
||||
return (rlim.rlim_cur == RLIM_INFINITY) ? (unsigned long)-1 : rlim.rlim_cur;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user