kmatheussen / jack_capture

A program for recording soundfiles with jack
http://www.notam02.no/arkiv/src/
Other
75 stars 28 forks source link

cleanup #13

Closed x42 closed 12 years ago

x42 commented 12 years ago
kmatheussen commented 12 years ago

Thanks! I also wonder if it works to fork the execv call, and exit the parent process immediately? The reason I added '&' after the system command was to avoid growing up more and more unreleased memory.

x42 commented 12 years ago

I tried that that first, it only works if jack_capture runs in --daemon mode. otherwise there's a live-loop: the forked process exits immediately just as with system(.."&");

x42 commented 12 years ago

BTW - with execv(), I don't see the process growing in or leaking memory. But I've only checked with 'top'. There might be tiny leaks...

as for forking: I don't think that should be done. jack_capture must not exit and automatically go into background (unless the user explicitly requests that).

kmatheussen commented 12 years ago

As you pointed out in private email, the man page of execve() says "does not return on success, and the text, data, bss, and stack of the calling process are overwritten by that of the program loaded.", so then it's all good.