Skip to content
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

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

washort
Copy link

@washort washort commented Apr 26, 2017

No description provided.

@washort washort force-pushed the external-memory-tracking branch from 5ce51ba to 7e951f6 Compare April 26, 2017 14:07
@washort washort changed the base branch from master to dev April 26, 2017 15:02
@trink trink added this to the Sprint May01-May14 milestone Apr 26, 2017
@@ -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;
Copy link
Contributor

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;
Copy link
Contributor

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)
Copy link
Contributor

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;
Copy link
Contributor

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

@trink trink removed this from the Sprint May01-May14 milestone May 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants