Lowered the default value of CLUSTER_CACHE_SIZE#1038
Merged
Conversation
!!! IMPORTANT !!! For this change to take effect when rebuilding/recompiling the project in an existing build directory, the following command must be explicitly executed: ``` meson configure -D CLUSTER_CACHE_SIZE=16777216 ``` --- The default value of CLUSTER_CACHE_SIZE was made low-end-device-friendly - the cluster cache max memory size was lowered from 512MiB to 16MiB. For mono-ZIM-file use cases (when a single ZIM-file is open at a time) this approximately returns the memory usage by the cluster cache to how it used to be before the cluster cache was made global (shared across all open ZIM-files). Note however that there is some ambiguity with respect to what memory usage means - there is virtual memory vs physical memory. Current implementation of cluster cache memory management targets physical memory usage on systems supporting mmap, where allocation of virtual memory by the cluster cache can exceed the actual physical memory usage by a factor of ~5x-9x. On systems not supporting mmap (or with an implementation of malloc not utilizing mmap for large allocations) the consumption of physical memory should equal the size of allocated virtual memory, and the actual memory usage will exceed the cache memory limit by the said factor, i.e. as much as 144MiB can be consumed by the cluster cache at the default setting.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1038 +/- ##
=======================================
Coverage 56.25% 56.25%
=======================================
Files 101 101
Lines 5016 5016
Branches 2185 2185
=======================================
Hits 2822 2822
Misses 738 738
Partials 1456 1456 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
!!! IMPORTANT !!!
For this change to take effect when rebuilding/recompiling the project in an existing build directory, the following command must be explicitly executed:
The default value of CLUSTER_CACHE_SIZE was made low-end-device-friendly - the cluster cache max memory size was lowered from 512MiB to 16MiB. For mono-ZIM-file use cases (when a single ZIM-file is open at a time) this approximately returns the memory usage by the cluster cache to how it used to be before the cluster cache was made global (shared across all open ZIM-files).
Note however that there is some ambiguity with respect to what memory usage means - there is virtual memory vs physical memory. Current implementation of cluster cache memory management targets physical memory usage on systems supporting mmap, where allocation of virtual memory by the cluster cache can exceed the actual physical memory usage by a factor of ~5x-9x.
On systems not supporting mmap (or with an implementation of malloc not utilizing mmap for large allocations) the consumption of physical memory should equal the size of allocated virtual memory, and the actual memory usage will exceed the cache memory limit by the said factor, i.e. as much as 144MiB can be consumed by the cluster cache at the default setting.