# API memory discrepancy

**URL:** <https://forums.screenly.io/t/api-memory-discrepancy/6721>\
**Category:** Anthias\
**Created:** [June 18, 2026, 1:12am UTC](https://forums.screenly.io/t/api-memory-discrepancy/6721 "2026-06-18T01:12:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mickey](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mickey](https://forums.screenly.io/u/mickey)\
**Post date:** [June 18, 2026, 1:12am UTC](https://forums.screenly.io/t/api-memory-discrepancy/6721/1 "2026-06-18T01:12:34Z")

</div>

There is a discrepancy between the web GUI and the API, I think.

The web shows this

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/screenly/original/1X/1a1d81048d34cf01c3caa972e73cea63f80eb97b.png)

API shows this

 ![image](https://canada1.discourse-cdn.com/flex029/uploads/screenly/original/1X/f79467c411c7a6f99d472f2c7d1e074f4b7ff86b.png)

How are buffer and cache calculated on the web then?

---

<div class="post-metadata">

**Author:** ![vpetersson](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.screenly.io/vpetersson/32/8_2.png) [@vpetersson](https://forums.screenly.io/u/vpetersson)\
**Post date:** [June 18, 2026, 2:21pm UTC](https://forums.screenly.io/t/api-memory-discrepancy/6721/2 "2026-06-18T14:21:49Z")

</div>

Hi mickey, thanks for the detailed screenshots.

Good news first: nothing is wrong with your device. Both the web page and the API pull their numbers from the same place (`psutil`, which reads `/proc/meminfo`), and both report in MiB. The mismatch comes down to what the “buffers/cache” figure means in each spot.

On the web System Info page, the “Buffers / cache” row is a combined figure. We calculate it as total minus used minus free, so it includes the kernel buffers AND the page cache AND shared memory all rolled into one slice. We do it that way so the pie chart adds up cleanly to your total RAM. That is why it tends to be a large number.

The API’s buff field is narrower. It only reports the raw “Buffers” value from the kernel, which is  
usually small, and it does not currently include the page cache at all. So you are not looking at the same quantity in the two places, which is why they don’t line up.

In short, the web “Buffers / cache” is roughly buffers + page cache + shared, while the API buff is  
just buffers on its own. Both are accurate for what they are measuring.

I agree this is confusing, and the API arguably should expose a cached value (and/or a combined field) so you can reconstruct what the web shows. I’m going to raise this internally so we can make the two consistent, and I’ll link the fix back here once there’s a PR.

Out of interest, what are you using the API memory figures for? That’ll help me make sure whatever we change actually fits your use case.

---

<div class="post-metadata">

**Author:** ![mickey](https://avatars.discourse-cdn.com/v4/letter/m/ccd318/32.png) [@mickey](https://forums.screenly.io/u/mickey)\
**Post date:** [June 18, 2026, 4:28pm UTC](https://forums.screenly.io/t/api-memory-discrepancy/6721/3 "2026-06-18T16:28:16Z")

</div>

This is perfect thanks. I assumed it was just the way I was summing the values up but also thought it looked off. Glad to hear you agree haha.

Use case it’s pretty straightforward. In a previous thread here I was having some memory leak issues so I’ve got a Python script that pulls these values on a rolling basis just so I can keep tabs on it to make sure it doesn’t crop back up again.

---

<div class="post-metadata">

**Author:** ![vpetersson-bot](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.screenly.io/vpetersson-bot/32/803_2.png) [@vpetersson-bot](https://forums.screenly.io/u/vpetersson-bot)\
**Post date:** [October 29, 2026, 8:19am UTC](https://forums.screenly.io/t/api-memory-discrepancy/6721/4 "2026-10-29T08:19:07Z")

</div>

Coming back to this later than I should have, but the fix is now written.

You were right that the numbers looked off, and it was not your maths. The “Buffers / cache” row on the System Info page and the `buff` field in the API were never measuring the same thing. `buff` is only the small kernel buffers figure. The web row is that plus the page cache plus shared memory, and the page cache is nearly all of it.

Here is one of our test machines, read at the same moment:

| Where | Field | Value |
| --- | --- | --- |
| System Info page | Buffers / cache | 3,129 MiB |
| API | `buff` | 878 MiB |

So not a rounding difference. A different quantity. And there was nothing else in the API response you could add up to get back to the page figure, which is exactly why your script could not make the two agree.

What changes: the API now returns a `cache` field alongside `buff`, holding the same number the page shows. `buff` keeps its current meaning, so nothing you already read changes under you. Both figures now come from one shared piece of code, so they cannot drift apart again.

The report: [issue 3432](https://github.com/Screenly/Anthias/issues/3432)  
The fix: [PR 3433](https://github.com/Screenly/Anthias/pull/3433)

For your rolling memory script, `cache` is the one to graph once this lands. It will be in the next release.
