cache_memlimit command for tuning runtime maxbytes#170
Closed
dormando wants to merge 1 commit into
Closed
Conversation
Allows dynamically increasing the memory limit of a running system, if memory isn't being preallocated. If `-o modern` is in use, can also dynamically lower memory usage. pages are free()'ed back to the OS via the slab rebalancer as memory is freed up. Does not guarantee the OS will actually give the memory back for other applications to use, that depends on how the OS handles memory.
|
|
||
| static void process_memlimit_command(conn *c, token_t *tokens, const size_t ntokens) { | ||
| uint32_t memlimit; | ||
| assert(c != NULL); |
Contributor
There was a problem hiding this comment.
If we're checking for c != NULL, why isn't they're also a NULL check for tokens?
Member
Author
There was a problem hiding this comment.
I think the assert() there is cargo culted by me and could be done once at the top of the process_* stack. Tokens can't be null because you can't get to that function if it's null.
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.
Allows dynamically increasing the memory limit of a running system, if memory
isn't being preallocated.
cache_memlimit Nwhere N is a value in megabytes. Value can go up or down.If
-o modernis in use, can also dynamically lower memory usage. pages arefree()'ed back to the OS via the slab rebalancer as memory is freed up. Does
not guarantee the OS will actually give the memory back for other applications
to use, that depends on how the OS handles memory.