forked from sysprog21/rv32emu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify lfu cache to shrink memory usage
In the original LFU cache implementation, the memory usage fluctuates with changes in the THRESHOLD setting. Consequently, when we increase the THRESHOLD, the memory usage increases significantly. To address this issue, I have modified the implementation of LFU cache lists. Now, memory is allocated for these lists only when a cache entry is appended to them. The original memory usage for cache lists was THRESHOLD (32678) * sizeof(struct list_head). The proposed implementation reduces it to cache_size (1024) * sizeof(struct list_head).
- Loading branch information
Yen-Fu Chen
committed
Sep 10, 2023
1 parent
7218652
commit 694f5aa
Showing
1 changed file
with
45 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters