From 081a6ffaea5300a6c9f648817092b99b9b60505b Mon Sep 17 00:00:00 2001 From: Yash Ladha <18033231+yashLadha@users.noreply.github.com> Date: Sat, 13 May 2023 23:58:25 +0530 Subject: [PATCH] doc: update measure memory rejection information If in case context is unable to allocate a promise then `ERR_CONTEXT_NOT_INITIALIZED` error will be thrown (as promise rejection) in the vm measureMemory call. PR-URL: https://github.com/nodejs/node/pull/41639 Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell Reviewed-By: Debadree Chatterjee --- doc/api/vm.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/api/vm.md b/doc/api/vm.md index f1f9ab84fa11ce..545986e4f3df4f 100644 --- a/doc/api/vm.md +++ b/doc/api/vm.md @@ -1140,8 +1140,9 @@ current V8 isolate, or the main context. exits before the next GC). With eager execution, the GC will be started right away to measure the memory. **Default:** `'default'` -* Returns: {Promise} If the memory is successfully measured the promise will +* Returns: {Promise} If the memory is successfully measured, the promise will resolve with an object containing information about the memory usage. + Otherwise it will be rejected with an `ERR_CONTEXT_NOT_INITIALIZED` error. The format of the object that the returned Promise may resolve with is specific to the V8 engine and may change from one version of V8 to the next.