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

Cleanup BTF #1011

Merged
merged 1 commit into from
Jul 12, 2024
Merged

Cleanup BTF #1011

merged 1 commit into from
Jul 12, 2024

Conversation

grcevski
Copy link
Contributor

@grcevski grcevski commented Jul 12, 2024

The Linux BTF memory parsed by ebpf-go holds onto all the symbols. On my machine this is 30 MB. From this issue I found that we can cleanup this memory manually after we've loaded the programs cilium/ebpf#1063. It's hard to tell exactly when for performance reasons, but I want to see if I can pass the tests with manual cleanup on every tracer install.

Beyla started without any programs, resident state size of the memory after pprof which triggers GC:

Before:

VmRSS:	           83884 kB
RssAnon:	   50924 kB
RssFile:	   32960 kB

After:

VmRSS:	           43312 kB
RssAnon:	   10032 kB
RssFile:	   33280 kB

From 83MB to 43MB.

@grcevski grcevski requested review from mariomac and marctc as code owners July 12, 2024 00:15
@codecov-commenter
Copy link

codecov-commenter commented Jul 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.16%. Comparing base (0c7d38f) to head (d87f51b).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1011      +/-   ##
==========================================
- Coverage   80.17%   80.16%   -0.01%     
==========================================
  Files         137      137              
  Lines       10930    10932       +2     
==========================================
+ Hits         8763     8764       +1     
- Misses       1685     1686       +1     
  Partials      482      482              
Flag Coverage Δ
integration-test 55.00% <100.00%> (-0.15%) ⬇️
k8s-integration-test 57.64% <100.00%> (-0.08%) ⬇️
oats-test 37.32% <100.00%> (+0.01%) ⬆️
unittests 50.01% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mariomac mariomac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's great!

Copy link
Contributor

@marctc marctc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicee!!

@grcevski grcevski merged commit f68fdb2 into grafana:main Jul 12, 2024
6 checks passed
@grcevski grcevski deleted the reduce_memory_usage branch July 12, 2024 16:27
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.

4 participants