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

Benchmark memory #8

Merged
merged 13 commits into from
Dec 8, 2024
Merged

Benchmark memory #8

merged 13 commits into from
Dec 8, 2024

Conversation

tayloraswift
Copy link
Owner

@tayloraswift tayloraswift commented Dec 8, 2024

this PR adds hard memory consumption benchmarks to validate the absolute minimum RAM needed to use the Firewall, which is currently about 160 MB. this figure makes a lot of sense, the Firewall itself is about 63 MB, and we need to copy the buffer once in order to turn Foundation.Data into [UInt8], which would transiently use 126 MB of RAM. the remaining memory can be attributed to the test application itself, and its linked libraries:

     63 MB — Used by IP.Firewall itself
     63 MB — Used by Foundation.Data (would not appear in production)
     34 MB — Used by the test application, including the Swift stdlib
    2.6 MB — libstdc++.so.6
    2.1 MB — libc.so.6
    1.0 MB — libm.so.6
+   0.2 MB — libgcc_s.so.1
——————————
    165 MB

i guess the C/C++ libraries get loaded lazily, which is why the benchmark squeaks by with 160 MB of RAM and no swap.

@tayloraswift tayloraswift merged commit 6a01526 into master Dec 8, 2024
9 checks passed
@tayloraswift tayloraswift deleted the benchmark-memory branch December 8, 2024 00:59
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.

1 participant