-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Large virtual memory (13-20 GB) when running Peertube without --jitless #45557
Comments
@pbeyssac Could you provide the output of |
Thanks for your reply. Here goes:
Note that it is FreeBSD's /proc, which is different from the Linux output, so here's the relevant bit in the man page:
Please find attached the memory map of the process as returned by /proc/${pid}/map. Another remark (I'm not sure this is relevant, but just in case): the process I started with --jitless died on an error which looks like a Peertube error, but which never happens when running with JIT. Perhaps a race condition due to the code running at a different speed.
|
This looks like |
I confirm it is really /proc/${pid}/status on FreeBSD (see the "cat", directly copied from my terminal). FreeBSD /proc differs from Linux and has no /proc/*/stat anyway. Here /rlimit just in case (but these are static limits, not usage):
man page excerpt:
Excerpt from ps:
|
Sorry, I was looking at the man page for CentOS, not FreeBSD. The RSS looks reasonable. Maybe the JIT compiler creates a bunch of large memory mappings thus blowing up the reserved address space in virtual memory, but that's usually not a problem. (For example, V8 might decide to reserve a 4GiB address range for every single WebAssembly instance for performance reasons.) |
That's what happens. I'm going to guess peertube loads wasm files (undici does, of that I'm sure) and V8 makes large reservations for wasm modules, basically XL guard pages. That's virtual memory though, not RSS, so it's harmless. |
Version
v18.7.0 (also tested on node14)
Platform
FreeBSD tube 12.3-RELEASE FreeBSD 12.3-RELEASE GENERIC amd64 (also tested on Linux)
Subsystem
No idea (but no idea how to check for this)
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Same behaviour at every run. Seems easy to reproduce.
What is the expected behavior?
13-20 GB seems to be a lot more than necessary.
Starting with --jitless seems to shrink the memory size significantly to ~1 GB, which looks more reasonable:
Perhaps there's a specific Javascript module with specific code which triggers excessive memory use in the JIT compiler, but I have no idea how to check for this.
What do you see instead?
nodejs grows up to 13 GB - 20 GB memory (depending on node version/OS -- same observations on node14/FreeBSD, Linux, and on other Peertube instances)
Additional information
Posted here on the Peertube forum, where I was advised to come here and ask for help.
https://framacolibri.org/t/high-memory-use-for-node-process-v4-3-0-v4-3-1/16155/7
The text was updated successfully, but these errors were encountered: