Re: will system() waste memory?
- From: "Daniel Rock" <v200742@xxxxxxxxxxx>
- Date: Mon, 15 Oct 2007 14:32:08 +0000 (UTC)
Bin Chen <binary.chen@xxxxxxxxx> wrote:
Most call to system() is to run a brand new program but I want to know
if the parent run system() after allocated a large memory, will the
memory duplicated to the systemed program which is unnecessary?
If so, how can I do to avoid the wasted memory?
For this reason posix_spawn() has been introduced:
http://www.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html
See the discussion in the "Rationale" section.
You can assume system() uses the optimal implementation available on your
platform. system() might succeed in some cases where fork() + exec() would
fail.
--
Daniel
.
- Follow-Ups:
- Re: will system() waste memory?
- From: Rainer Weikusat
- Re: will system() waste memory?
- References:
- will system() waste memory?
- From: Bin Chen
- will system() waste memory?
- Prev by Date: Re: will system() waste memory?
- Next by Date: Problem with popen
- Previous by thread: Re: will system() waste memory?
- Next by thread: Re: will system() waste memory?
- Index(es):
Relevant Pages
|