node
node copied to clipboard
src: fix available memory best guess logic
GuessMemoryAvailableToTheProcess() assumed that the return value of uv_get_constrained_memory() is a reasonable upper bound. It doesn't have to be, it can be much larger than actual available memory.
There's another uv_get_constrained_memory() call in src/api/environment.cc that looks mostly alright but it compares against total memory, not free memory.