-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
External memory-usage tracking #195
base: dev
Are you sure you want to change the base?
Conversation
5ce51ba
to
7e951f6
Compare
@@ -54,6 +54,8 @@ typedef struct lsb_heka_sandbox lsb_heka_sandbox; | |||
typedef struct lsb_heka_stats { | |||
unsigned long long mem_cur; | |||
unsigned long long mem_max; | |||
unsigned long long ext_mem_cur; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These need to be added to the end of the struct otherwise it will break existing clients.
size_t newsize = hsb->lsb->usage[LSB_UT_EXTERNAL_MEMORY][LSB_US_CURRENT] + sizechange; | ||
|
||
if (newsize > hsb->lsb->usage[LSB_UT_EXTERNAL_MEMORY][LSB_US_MAXIMUM]) { | ||
hsb->lsb->usage[LSB_UT_EXTERNAL_MEMORY][LSB_US_MAXIMUM] = newsize; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should report back an OOM condition
}; | ||
} | ||
|
||
size_t lsb_heka_get_ext_memory_limit(lsb_heka_sandbox *hsb) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't believe this is needed as the adjustment should manage and report back an OOM condition. Also they could retrieve it through the stats function so it is a bit redundant.
|
||
void lsb_heka_adjust_ext_memory_usage(lsb_heka_sandbox *hsb, int sizechange) | ||
{ | ||
size_t newsize = hsb->lsb->usage[LSB_UT_EXTERNAL_MEMORY][LSB_US_CURRENT] + sizechange; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be pushed down to a lsb_adjust API
No description provided.