From 25e5ae41688676a5fd29b2e2e7602168eee4ceb5 Mon Sep 17 00:00:00 2001 From: Jamie Davis Date: Sat, 9 Jun 2018 14:29:51 -0400 Subject: doc: note synchronous part of child_process.spawn 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: https://github.com/nodejs/node/issues/14917 PR-URL: https://github.com/nodejs/node/pull/21234 Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Trivikram Kamat --- doc/api/child_process.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'doc') diff --git a/doc/api/child_process.md b/doc/api/child_process.md index 372f8bbaf44..e71bf89f913 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -661,6 +661,12 @@ child registers an event handler for the [`'disconnect'`][] event or the [`'message'`][] event. This allows the child to exit normally without the process being held open by the open IPC channel.* +On UNIX-like 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 more information, +see [V8 issue 7381](https://bugs.chromium.org/p/v8/issues/detail?id=7381). + See also: [`child_process.exec()`][] and [`child_process.fork()`][]. ## Synchronous Process Creation -- cgit v1.2.3