-
Notifications
You must be signed in to change notification settings - Fork 29.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory usage (external) reports a negative value? #21570
Comments
That probably means you're using an add-on (a native module) with a bug in it - it's miscalling If you can track this down to Node.js core (i.e., exclude add-ons), let me know and I'll reopen. |
OK, I will try to remove all external modules and run the basic functions of the server to try. However, I did not observed that issue on the identical server code ran on version 6.x.x and 8.x.x. Anyway, I will try to run a sample cut-down server without any external module. |
@bnoordhuis I track it down that it got the issue in Node.js core. I can replicate the case that I can have negative external memory from "process.memoryUsage()" call. The situation is simple: You keep making an https GET request to get some contents from a server and do a frequenct gc() call (the V8 garbage collection call), then the external memory reported will going down even keep going even the value is negative. I think it affects version 10.4.x (may be earlier) to 10.5.0 (latest version) on at least both Windows 64-bit version and the arm v6l version. I suspect it affects all platforms. I found it do not affect v10.1.0 and earlier version. A simple but not very clean code can show the issue: Notes: http seems not affected, and also you need to run it with
|
Clarification: The issue I tested is at the "client" side that making HTTPS request, not at the server side. |
Thanks, reopened and labels updated. |
Updated the sample code to demo the issue with a simpler code using a public HTTPS service. |
@bnoordhuis Just curious if this is not yet classified as a bug so nobody is looking at it? Or it is low priority and just waiting in some queues? I am not familiar with the process here, but I agree it is not high-priority as it seems not breaking anything other than reporting negative memory sizes. |
FWIW, I've been seeing this on Node 10.9 as well. |
Yea I've hit this multiple times as well. Made a fix here, #22594 |
Presumably fixed in 1287e52 which first appeared in Node.js 11.0.0. Please comment (or re-open if GitHub lets you) if you are experiencing this bug with a version of Node.js that is 11.x or newer. |
Running some http server process in node.js in REPL environment (under tmux), the function: process.memoryUsage() function can return a negative value. Is that a bug? The process (server) was run for many days, and I sometimes use process.memoryUsage() to check the values and I found:
The external memory is negative, but it was still postive 2 days ago when I checked. Notes, I run the node.js with flags:
--expose-gc --max-old-space-size=256
This is running on a Raspberry Pi ZERO W.
The text was updated successfully, but these errors were encountered: