Skip to content
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

Out of memory Large Library #73

Open
segator opened this issue Dec 12, 2018 · 2 comments
Open

Out of memory Large Library #73

segator opened this issue Dec 12, 2018 · 2 comments

Comments

@segator
Copy link

segator commented Dec 12, 2018

Out of memory on a 32GB system (30 GB not used)

plex-sync serverA/2,r serverB/2,rw
Large Library(80K episodes on 2 servers)
<--- Last few GCs --->

[4332:0x55a7b4ce31d0] 638448 ms: Mark-sweep 1655.4 (1720.0) -> 1655.4 (1688.5) MB, 2072.7 / 0.0 ms last resort GC in old space requested
[4332:0x55a7b4ce31d0] 640695 ms: Mark-sweep 1655.4 (1688.5) -> 1655.4 (1688.5) MB, 2246.6 / 0.0 ms last resort GC in old space requested

<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x72c21a18fe1
1: /* anonymous /(aka / anonymous /) [/usr/local/lib/node_modules/plex-sync/lib/plex.js:~124] [pc=0x200bebd43a3e](this=0x72c21a02241 ,video=0x64a08ede011 )
2: arguments adaptor frame: 3->1
3: forEach(this=0x234fd89ec6f9 <JSArray[32]>)
4: / anonymous /(aka / anonymous */) [/usr/local/lib/node_modules/plex-sync/lib/plex.js:124] [bytecode=...

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [node]
2: 0x55a7b3305011 [node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [node]
5: v8::internal::Factory::NewUninitializedFixedArray(int) [node]
6: 0x55a7b2ef1add [node]
7: v8::internal::Runtime_GrowArrayElements(int, v8::internal::Object**, v8::internal::Isolate*) [node]
8: 0x200beba840bd

@jacobwgillespie
Copy link
Owner

At some point I'd like to optimize plex-sync so that it's not holding so much information in memory, but as a temporary workaround, you can increase the node heap size. Node limits itself to around 1.7GB of memory on 64-bit machines, so for instance to run with 4GB of memory:

$ node --max-old-space-size=4096 `which plex-sync` [...]

@RyanWor
Copy link

RyanWor commented Oct 27, 2022

Sorry to bump an old thread, I am still getting memory errors with even as much as 32gb. Does anyone know if there is a improved fork of this or a better solution that exists now? Need to sync watched states in two libraries and don't have file access to one server nor do I want to risk messing directly with .db files. Any help is greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants