Skip to content

Reap child processes #442

@FJShen

Description

@FJShen

Image

This screenshot of the tree-view of running processes was taken when the trace post processor has finished processing 2 kernels and was in the midst of processing the third.

For the first two kernels, the child process forked for supplying raw traces to the post processor, and the child process forked for consuming the post-processed trace were never "reaped" after they have completed. As a result, their corresponding processes remain in a zombie state and won't really "disappear" until the parent process has terminated. The overhead of this wacky behavior is small, but each zombie process occupies an entry in the process table. In the case a post-processor needs to process many kernels, the process table could end up filling up.

The remedy to this problem is to call wait() or waitpid() in the parent process.

This remedy should be applied to the trace post processor program. However, despite the tracer program and the PipeReader object of the simulator program also uses xz subprocesses, they are not affected, because they do not explicitly use fork to spawn the children processes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions