Skip to content

Commit

Permalink
doc: note synchronous part of child_process.spawn
Browse files Browse the repository at this point in the history
If an application has a large RSS (GB), jorangreef
observed that child_process.spawn will block the
event loop for ms-s.

This is surprising behavior and merits documentation.

Refs: #14917
  • Loading branch information
davisjam committed Jun 9, 2018
1 parent 641d4a4 commit d9fcde6
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doc/api/child_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ without blocking the Node.js event loop. The [`child_process.spawnSync()`][]
function provides equivalent functionality in a synchronous manner that blocks
the event loop until the spawned process either exits or is terminated.

*Note*: On some operating systems, the [`child_process.spawn()`][] method
performs memory operations synchronously before decoupling the event loop
from the child. Applications with a large memory footprint may find frequent
[`child_process.spawn()`][] calls to be a bottleneck.

For convenience, the `child_process` module provides a handful of synchronous
and asynchronous alternatives to [`child_process.spawn()`][] and
[`child_process.spawnSync()`][]. *Note that each of these alternatives are
Expand Down

0 comments on commit d9fcde6

Please sign in to comment.