Fatal error: runtime: out of memory during Plex playback

I am using Rclone cache+crypt+mount together with Plex and GDrive following this guide: https://bytesized-hosting.com/pages/rclone-gdrive. The playback worked fine in the beginning. But after a couple of minutes, the playback is terminated. The log file shows: Fatal error: runtime: out of memory. The machine hosting the Plex media server has a memory of 1GB.
My config file is as follows:

type = drive
client_id = ***
client_secret = ***
scope = drive
token = ***
type = cache
remote = gdrive:/plexlibrary
plex_url =
plex_username = ***
plex_password = ***
chunk_size = 10M
info_age = 1d
chunk_total_size = 5G
type = crypt
remote = gcache:/crypt
filename_encryption = standard
directory_name_encryption = true
password = ***
password2 = ***

My command is:

rclone mount gcrypt: /mnt/gdrive -v --log-file=/rclone.log --allow-other --allow-non-empty

Part of the log:

fatal error: runtime: out of memory
runtime stack:
runtime.throw(0x138ddca, 0x16)
/home/travis/.gimme/versions/go1.12.4.linux.amd64/src/runtime/panic.go:617 +0x72
runtime.sysMap(0xc018000000, 0x4000000, 0x20a5798)
/home/travis/.gimme/versions/go1.12.4.linux.amd64/src/runtime/mem_linux.go:170 +0xc7
runtime.(*mheap).sysAlloc(0x208cb80, 0xa02000, 0x208cb90, 0x501)
/home/travis/.gimme/versions/go1.12.4.linux.amd64/src/runtime/malloc.go:633 +0x1cd
runtime.(*mheap).grow(0x208cb80, 0x501, 0x0)
/home/travis/.gimme/versions/go1.12.4.linux.amd64/src/runtime/mheap.go:1232 +0x42
runtime.(*mheap).allocSpanLocked(0x208cb80, 0x501, 0x20a57a8, 0xc0000b3a20)
/home/travis/.gimme/versions/go1.12.4.linux.amd64/src/runtime/mheap.go:1150 +0x3a7
runtime.(*mheap).alloc_m(0x208cb80, 0x501, 0x101, 0x0)
/home/travis/.gimme/versions/go1.12.4.linux.amd64/src/runtime/mheap.go:977 +0xc2

followed by lots of lines similar to this.

It seems like you ran out of memory on the machine as that’s the error. 1GB is probably not enough to run plex and all the other items you are running unfortunately.

You can try to configure things with less memory and remove the cache perhaps, but I’m not sure you’ll have much luck.

That guide is pretty dated as well and has just isn’t that good imo.

You can try to turn off --buffer-size 0M as you are using the cache backend and you can turn off chunk memory use --cache-chunk-no-memory

Make sure you are on the latest version as well as that would help. Other than that, you really need more than 1GB of memory to run Plex + Rclone.

Thanks for your help! Still have a question. Will it be of any help if I adjust the cache chunk size? And what did you mean by “removing the cache”?

The cache really isn’t needed. So you can go point directly to your encrypted folder without having the cache in between.

Not sure adjusting the cache size would do much as it’s already very small at 10M.

Ok. I’ll try removing the cache.

I set the chunk size to 1M and added the flags —buffer-size 0M and —cache-chunk-no-memory. It seems alright now. The memory consumption is much more moderate.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.