system and popen fail in case of big application

Sergey Melnikov melnikov.sergey.v@gmail.com
Sun Sep 9 22:16:00 GMT 2018


Hi all,

I'm developing JNI code for a Java application. My code works fine in
case of small heap size. Nevertheless, if I set heap size to something
reasonably big (like 20Gb on my dev PC with 32Gb of RAM), 'popen' and
'system' glibc calls don't work with ENOMEM errno.

It looks like I'm not the first person who has faced this issue since
there is quite the same question on stackoverflow
(https://stackoverflow.com/questions/46574798/enomem-from-popen-for-system-while-there-is-enough-memory?rq=1).

So, my question is if does it worth to rewrite existing popen/system
calls with posix_spawn as StackOverflow recommends? If so, I may
implement and contribute this to glibc.

--Sergey



More information about the Libc-alpha mailing list