[PR #3837] [MERGED] Fix BaseItems not being cached in-memory #9721

Closed
opened 2026-02-07 06:07:18 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jellyfin/jellyfin/pull/3837
Author: @cvium
Created: 8/7/2020
Status: Merged
Merged: 8/7/2020
Merged by: @Bond-009

Base: masterHead: fix_memorycache


📝 Commits (1)

  • 0cf7599 Use MemoryCache.Set since SetValue does not flush to cache automatically.

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 Emby.Server.Implementations/Library/LibraryManager.cs (+1 -1)

📄 Description

Changes
Changed to MemoryCache.Set since SetValue does not flush automatically. An entry is only added to the MemoryCache when the entry is disposed, which Set does for us. No BaseItems were ever cached 🤣

I scanned my TV shows with "Refresh all metadata" for 19 minutes and got the following results:

Memory allocations before the change:
image

Memory allocations after the change
image


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jellyfin/jellyfin/pull/3837 **Author:** [@cvium](https://github.com/cvium) **Created:** 8/7/2020 **Status:** ✅ Merged **Merged:** 8/7/2020 **Merged by:** [@Bond-009](https://github.com/Bond-009) **Base:** `master` ← **Head:** `fix_memorycache` --- ### 📝 Commits (1) - [`0cf7599`](https://github.com/jellyfin/jellyfin/commit/0cf75992a8cfbf0795ea3837a926c37ab7e4cbf2) Use MemoryCache.Set since SetValue does not flush to cache automatically. ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `Emby.Server.Implementations/Library/LibraryManager.cs` (+1 -1) </details> ### 📄 Description <!-- Ensure your title is short, descriptive, and in the imperative mood (Fix X, Change Y, instead of Fixed X, Changed Y). For a good inspiration of what to write in commit messages and PRs please review https://chris.beams.io/posts/git-commit/ and our documentation. --> **Changes** Changed to MemoryCache.Set since SetValue does not flush automatically. An entry is only added to the MemoryCache when the entry is disposed, which Set does for us. No BaseItems were ever cached 🤣 I scanned my TV shows with "Refresh all metadata" for 19 minutes and got the following results: Memory allocations _before_ the change: ![image](https://user-images.githubusercontent.com/675118/89634081-17e04a80-d8a5-11ea-9865-5199341cf4c3.png) Memory allocations _after_ the change ![image](https://user-images.githubusercontent.com/675118/89634117-23337600-d8a5-11ea-8e5d-138c4a6455e6.png) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-07 06:07:18 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/jellyfin#9721