relay icon indicating copy to clipboard operation
relay copied to clipboard

Memory health checks ignore swap changes

Open ChlorideCull opened this issue 9 months ago • 3 comments

Because of this line in MemoryStat, it never refreshes info on swap, just RAM usage, which means it will effectively ignore any changes to swap after the initial load when starting the process.

In my case, I ran into it because I added swap space to a running host, yet the health check still failed, because it never became aware of the added swap space.

In addition, hypothetically, if you start the relay with high RAM usage but free swap space, the health check will never fail, because it will always think there's plenty of swap available.

ChlorideCull avatar Mar 25 '25 10:03 ChlorideCull

Hi, thanks for the report.

We did some analysis of sysinfo and discussed internally. We are unsure about the best approach moving forward since we rely on RSS when using cgroups to determine memory usage (we use RSS to exclude the page cache).

What would be your expectations? That we count the used memory as rss + used swap and the total as total memory + total swap?

iambriccardo avatar Mar 25 '25 13:03 iambriccardo

What would be your expectations? That we count the used memory as rss + used swap and the total as total memory + total swap?

That sounds logical, since the health checks that rely on this seem to exist to avoid an OOM situation, and that can't really happen if there's free swap available.

ChlorideCull avatar Mar 27 '25 13:03 ChlorideCull

We added this request to our internal board! We will track the work and follow up in case of any doubts/updates, thanks for reporting.

iambriccardo avatar Mar 28 '25 08:03 iambriccardo