enomem

Causes for ENOMEM from ::popen()

僤鯓⒐⒋嵵緔 提交于 2019-12-22 17:40:07
问题 I have an application that mostly works, but am having one condition wherein the call to ::popen() gets an error with errno set to ENOMEM. The man page for ::popen() refers you to page for ::fork() which itself lists ENOMEM with this brief comment on Linux: The fork() function may fail if: ENOMEM Insufficient storage space is available. I am wondering if I am really running out of memory, or perhaps some other resource like file descriptors? Can fork() give ENOMEM for something other than

munmap() failure with ENOMEM with private anonymous mapping

喜夏-厌秋 提交于 2019-12-18 03:51:13
问题 I have recently discovered that Linux does not guarantee that memory allocated with mmap can be freed with munmap if this leads to situation when number of VMA (Virtual Memory Area) structures exceed vm.max_map_count . Manpage states this (almost) clearly: ENOMEM The process's maximum number of mappings would have been exceeded. This error can also occur for munmap(), when unmapping a region in the middle of an existing mapping, since this results in two smaller mappings on either side of the

Is it possible to fork a process without inherit virtual memory space of parent process?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 02:25:20
问题 As the parent process is using huge mount of memory, fork may fail with errno of ENOMEM under some configuration of kernel overcommit policy. Even though the child process may only exec low memory-consuming program like ls. To clarify the problem, when /proc/sys/vm/overcommit_memory is configured to be 2, allocation of (virtual) memory is limited to SWAP + MEMORY * ration(default to 50%) . When a process forks, virtual memory is not copied thanks to COW. But the kernel still need to allocate

Is it possible to fork a process without inherit virtual memory space of parent process?

你离开我真会死。 提交于 2019-12-05 04:04:47
As the parent process is using huge mount of memory, fork may fail with errno of ENOMEM under some configuration of kernel overcommit policy. Even though the child process may only exec low memory-consuming program like ls. To clarify the problem, when /proc/sys/vm/overcommit_memory is configured to be 2, allocation of (virtual) memory is limited to SWAP + MEMORY * ration(default to 50%) . When a process forks, virtual memory is not copied thanks to COW. But the kernel still need to allocate virtual memory space. As an analogy, fork is like malloc(virtual memory space size) which will not

malloc returns NULL and sets errno to ENOMEM, but there is plenty of heap space available?

北战南征 提交于 2019-12-01 09:22:08
I have a situation in which malloc() returns NULL and sets errno to ENOMEM . But the CRT heap (which is growable) has plenty of memory to work with. At the time of malloc , my process memory is about 900 MB. The host process is a Java executable executed under the Sun HotSpot JVM. The malloc() I'm doing is 80 megabytes, and fails. If I do a 60 MB allocation, it succeeds. After that, a 50 MB allocation, followed by another one, and another one also succeed : clearly, I still have a lot of memory left but the 80 MB malloc seems too "big" to digest for the OS. I'm using Windows 7 x64 SP1 with 4

malloc returns NULL and sets errno to ENOMEM, but there is plenty of heap space available?

一曲冷凌霜 提交于 2019-12-01 06:19:00
问题 I have a situation in which malloc() returns NULL and sets errno to ENOMEM . But the CRT heap (which is growable) has plenty of memory to work with. At the time of malloc , my process memory is about 900 MB. The host process is a Java executable executed under the Sun HotSpot JVM. The malloc() I'm doing is 80 megabytes, and fails. If I do a 60 MB allocation, it succeeds. After that, a 50 MB allocation, followed by another one, and another one also succeed : clearly, I still have a lot of

munmap() failure with ENOMEM with private anonymous mapping

岁酱吖の 提交于 2019-11-30 17:15:53
I have recently discovered that Linux does not guarantee that memory allocated with mmap can be freed with munmap if this leads to situation when number of VMA (Virtual Memory Area) structures exceed vm.max_map_count . Manpage states this (almost) clearly: ENOMEM The process's maximum number of mappings would have been exceeded. This error can also occur for munmap(), when unmapping a region in the middle of an existing mapping, since this results in two smaller mappings on either side of the region being unmapped. The problem is that Linux kernel always tries to merge VMA structures if