title: Coding to avoid memory overcommit
body: <p>I have a program in C which uses a lot of memory and runs for quite some time, and then at the end it needs to call <code>system()</code> to invoke a simple shell command (which uses little memory), but due to overcommit being disabled (and lack of swap), this call to <code>system()</code> may fail due to lack of available memory.</p>
  
  <p>So far, it seems the only solution to avoid the memory issue is to add some asynchronous mechanism, e.g. invoking the <code>system()</code> call much earlier in the main process and then leaving the forked process waiting for the data to be sent later by the main process. This way, the forked process has a much smaller memory footprint.</p>
  
  <p>Am I missing something? Is there a simpler way to invoke this external process without incurring on memory overcommit issues? I see some mentions to <code>vfork()</code>, but they seem to imply it is an outdated mechanism.</p>