mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-03-02 22:46:55 -05:00
[Bug]: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #1257
Labels
No labels
authentication
awaiting release
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/audiobookshelf-advplyr#1257
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @GalaxyHopper on GitHub (Jul 17, 2023).
Describe the issue
After updating v2.3.1 Audiobookshelf stopped working. I tried to delete the sqlite file I'm not sure if it worked not much info on google how to delete a file inside a docker container or is it the sqlite file inside the mapped volume ?? The dev note is not clear. Anyways I deleted the one inside the mapped volume still the same error:
[2023-07-17 09:43:45] INFO: === Starting Server ===
[2023-07-17 09:43:45] INFO: [Server] Init v2.3.1
[2023-07-17 09:43:45] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2023-07-17 09:43:45] INFO: [Database] Db connection was successful
[2023-07-17 09:43:46] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting
<--- Last few GCs --->
[1:0x7f5830ad63f0] 6685 ms: Scavenge 2023.9 (2067.0) -> 2023.5 (2077.5) MB, 4.5 / 0.0 ms (average mu = 0.795, current mu = 0.638) allocation failure
[1:0x7f5830ad63f0] 6719 ms: Scavenge 2030.4 (2077.5) -> 2030.2 (2078.2) MB, 4.6 / 0.0 ms (average mu = 0.795, current mu = 0.638) allocation failure
[1:0x7f5830ad63f0] 6733 ms: Scavenge 2031.2 (2078.2) -> 2030.4 (2100.0) MB, 9.3 / 0.0 ms (average mu = 0.795, current mu = 0.638) allocation failure
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
Steps to reproduce the issue
n/a
Audiobookshelf version
v2.3.1
How are you running audiobookshelf?
Docker
@HStep20 commented on GitHub (Jul 17, 2023):
I am seeing the same issue with the recent update. I followed the provided step to remove the migrated database, and let v2.3.1 rebuild it, however it is still crashing upon startup with the same error message
@GalaxyHopper commented on GitHub (Jul 17, 2023):
@HStep20 I fixed it by adding a new environment variable in Portainer and recreated the container. It worked!
NODE_OPTIONS=--max-old-space-size=4096
Steps in Portainer:
Stop the container then click Duplicate/Edit. Scroll down and click on Env tab then click on + Add an environment variable
Add the following with no spaces
Name: NODE_OPTIONS
value: --max_old_space_size=4096
Redeploy the container.
Important to note that you've already mapped out your volumes outside the container otherwise redeploying will erase the container data and you may lose your data.
@HStep20 commented on GitHub (Jul 17, 2023):
Thanks! I have multiple large libraries, so I needed to bump it up to 8gb (--max-old-space-size=8192)
If anyone else attempts to fix this and still sees the same issue, try a higher memory limit
@sp0rus commented on GitHub (Jul 17, 2023):
For those running docker compose, adding these variables to the environment section of my compose file allowed me to update without this problem:
I attempted to use 4096MB first and still ran into the same problem. 8192 seemed to be the magic number.
@Gauva1n commented on GitHub (Jul 17, 2023):
8192 was the magic number for me too, finally got it up and running with a successful database migration. Actually says it's running v2.3.2 which isn't up on this repo yet, maybe it got pushed to docker hub first. Either way even v2.3.2 didn't work until I added that NODE_OPTIONS environment variable.
@advplyr commented on GitHub (Jul 17, 2023):
Should be fixed in v2.3.2
I put in the
max-old-space-sizein the dockerfile in addition to removed some of the initial memory usage. Let me know how it goes@Gauva1n commented on GitHub (Jul 17, 2023):
Removed the image, took the NODE_OPTIONS out of my compose fille and re-pulled v2.3.2, seems to be working now without putting those variables in the compose file. Thanks for the fix!
@GalaxyHopper commented on GitHub (Jul 17, 2023):
v2.3.2 is working I noticed that node options was included in the update. I reduced mine to 4096 since I have limited resources. Thanks @advplyr!
@adispi commented on GitHub (Jul 19, 2023):
i have tried to increase the NODE_OPTIONS to --max-old-space-size=20480
i cannot increase more as i am at 95% of memory.
i am still getting the same error:
Config /config /metadata
[2023-07-19 11:38:48] INFO: === Starting Server ===
[2023-07-19 11:38:48] INFO: [Server] Init v2.3.2
[2023-07-19 11:38:48] INFO: [Database] Initializing db at "/config/absdatabase.sqlite"
[2023-07-19 11:38:48] INFO: [Database] Db connection was successful
[2023-07-19 11:38:49] INFO: [Database] Db initialized with models: user, library, libraryFolder, book, podcast, podcastEpisode, libraryItem, mediaProgress, series, bookSeries, author, bookAuthor, collection, collectionBook, playlist, playlistMediaItem, device, playbackSession, feed, feedEpisode, setting
[2023-07-19 11:38:49] DEBUG: Set Log Level to DEBUG (Logger.js:87)
<--- Last few GCs --->
[1:0x7fca1bfc7410] 236770 ms: Mark-sweep (reduce) 20329.1 (20527.2) -> 20329.0 (20528.0) MB, 2130.0 / 0.0 ms (average mu = 0.878, current mu = 0.491) allocation failure scavenge might not succeed
[1:0x7fca1bfc7410] 237266 ms: Mark-sweep (reduce) 20330.0 (20528.0) -> 20329.8 (20529.0) MB, 369.5 / 0.0 ms (average mu = 0.863, current mu = 0.255) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
@advplyr commented on GitHub (Jul 22, 2023):
@adispi This got resolved from
v2.3.3I'm assuming? You were posting on Discord about a separate crash with podcasts.@advplyr commented on GitHub (Jul 22, 2023):
On the
edgedocker version I removed the--max-old-space-sizefrom the Dockerfile. If anyone that had the out of memory crash beforev2.3.3doesn't mind testingedgethat would be great@adispi commented on GitHub (Jul 22, 2023):
You are correct. The breaking of loading items on 2.3.3 solved it for me.
@jacroe commented on GitHub (Aug 16, 2023):
I'm still receiving the error even while on
edge. I've copied the output below. If there's anything specific details or steps you'd like me to do, please let me know.@advplyr commented on GitHub (Sep 17, 2023):
I'm going to close this one in favor of #2075. Most of the OOM issues have been resolved and the remaining one I'm aware of is with podcast libraries where you have thousands of episodes downloaded.
@advplyr commented on GitHub (Sep 17, 2023):
Duplicate of #2075