mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
[Bug]: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory #1255
Closed
opened 2026-04-24 23:37:34 +02:00 by adam
·
15 comments
No Branch/Tag Specified
master
book_tags_genres_dedupe
episode_download_fallback
Issue-4540-SortBy-StartedDate-and-FinishedDate
episode_meta_tagging
fix_authorize_race_condition
redirect_transcode_requests
progress_updated_sort
fix_ereader_socket_event
fix_change_empty_root_password
fix_podcast_session_track_index
fix_set_token
session_modal_user
localize_durations
fix_oidc_create_user
jwt_auth_refactor
fix_scanner_deleting_single_file_books
fix_mediaprogress_updatedat_2
experimental_next_client
podcast_episode_duration
episode-timestamps-clickable
book_author_secondary_sort_title
podcast_useragents
pathexists_user_access
fix_pathexists_join
book_author_secondary_sort
clean_duplicate_mediaprogress
sanitize_html_description
trix_prevent_attachments
check_path_api_fix
fix_mediaprogress_updatedat
increase_express_json_limit
fix_dockerfile_nunicode
search_episodes
audiobook_tools_update
episode_secondary_sorts
hls_stream_url_update
new_session_track_endpoint
audiobook_tools_enhancements
watcher_rescans_update
player_track_tooltip
fix_exclude_prefixes_crash
socket_item_events
fix_podcast_episode_scanner_promise
new_stats_controller
count_cache_for_userpermissions
parsing-opf-v3
validate_migration_files
fix-quick-match-all-crash
fix-chapter-end-sleep-timer
stringify_sequelize_query
remove-col-ambiguity
fix_next_prev_edit_description
details_trim_whitespace
fix_content_url_basepath
fix_logger_fatal
progress_bar_visibility
batch-edit-populate-map-details
feed_generator_updates
bookmark-modal-updates
migrate-library-item-in-scanner
migrate-new-library-items
migrate-podcasts-new-library-item-2
migrate-podcasts-new-library-item
fix-remove-episode-from-playlist
playback-session-use-new-library-item
refactor-library-item
fix-heatmap-caption
feed-episodes-upsert
share-media-player-media-session-api
remove-old-playlist
remove_old_collection_object
plugin-implementation-demo
feed_migration
refactor-feeds-from-item
fix_remove_authors_no_books
v2.17.3-fk-constraints-migration
migrations-first-upgrade
sqlite_2
feature/nuxt-target-server
waveform
sqlite
playlists
video
v2.35.1
v2.35.0
v2.34.0
v2.33.2
v2.33.1
v2.33.0
v2.32.1
v2.32.0
v2.31.0
v2.30.0
v2.29.0
v2.28.0
v2.27.0
v2.26.3
v2.26.2
v2.26.1
v2.26.0
v2.25.1
v2.25.0
v2.24.0
v2.23.0
v2.22.0
v2.21.0
v2.20.0
v2.19.5
v2.19.4
v2.19.3
v2.19.2
v2.19.1
v2.19.0
v2.18.1
v2.18.0
v2.17.7
v2.17.6
v2.17.5
v2.17.4
v2.17.3
v2.17.2
v2.17.1
v2.17.0
v2.16.2
v2.16.1
v2.16.0
v2.15.1
v2.15.0
v2.14.0
v2.13.4
v2.13.3
v2.13.2
v2.13.1
v2.13.0
v2.12.3
v2.12.2
v2.12.1
v2.12.0
v2.11.0
v2.10.1
v2.10.0
v2.9.0
v2.8.1
v2.8.0
v2.7.2
v2.7.1
v2.7.0
v2.6.0
v2.5.0
v2.4.4
v2.4.3
v2.4.2
v2.4.1
v2.4.0
v2.3.5
v2.3.4
v2.3.3
v2.3.2
v2.3.1
v2.3.0
v2.2.23
v2.2.22
v2.2.21
v2.2.20
v2.2.19
v2.2.18
v2.2.17
v2.2.16
v2.2.15
v2.2.14
v2.2.13
v2.2.12
v2.2.11
v2.2.10
v2.2.9
v2.2.8
v2.2.7
v2.2.6
v2.2.5
v2.2.4
v2.2.3
v2.2.2
v2.2.1
v2.2.0
v2.1.5
v2.1.4
v2.1.3
v2.1.2
v2.1.1
v2.1.0
v2.0.24
v2.0.23
v2.0.22
v2.0.21
v2.0.20
v2.0.19
v2.0.18
v2.0.17
v2.0.16
v2.0.15
v2.0.14
v2.0.13
v2.0.12
v2.0.11
v2.0.10
v2.0.9
v2.0.8
v2.0.7
v2.0.6
v2.0.5
v2.0.4
v2.0.3
v2.0.2
v2.0.1
v1.7.2
v1.7.1
v1.7.0
v1.6.0
v1.5.5
v1.5.0
v1.4.11
v1.4.9
v1.4.7
v1.4.6
v1.4.4
v1.4.2
v1.4.0
v1.4.1
v1.3.4
v1.3.3
v1.3.1
v1.2.8
v1.2.6
v1.2.5
v1.2.4
v1.2.1
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.0.0
0.9.61-beta.0
0.9.61-beta
Labels
Clear labels
authentication
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
pull-request
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
Mirrored from GitHub Pull Request
No Label
bug
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
adam (Adam Melkus)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/audiobookshelf#1255
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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 18, 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 18, 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 18, 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 18, 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 18, 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 18, 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 17, 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