File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -251,8 +251,11 @@ static void MemoryUsage(const FunctionCallbackInfo<Value>& args) {
251251
252252static void GetConstrainedMemory (const FunctionCallbackInfo<Value>& args) {
253253 uint64_t value = uv_get_constrained_memory ();
254- // UINT64_MAX means a constraining mechanism exists but no limit is set.
255- // Map to 0 per documented behavior: "If there is no constraint, 0 is returned."
254+ // When cgroups are enabled but no memory limit is set (e.g. a default
255+ // Docker container without --memory), libuv returns UINT64_MAX instead of 0.
256+ // UINT64_MAX is not a meaningful memory constraint, so map it to 0 to
257+ // indicate "no constraint", consistent with the documented behavior of
258+ // process.constrainedMemory(): "If there is no constraint, 0 is returned."
256259 if (value == UINT64_MAX) value = 0 ;
257260 args.GetReturnValue ().Set (static_cast <double >(value));
258261}
You can’t perform that action at this time.
0 commit comments