summaryrefslogtreecommitdiffstats
path: root/src/collectors/common-contexts
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:26:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-11-09 08:26:49 +0000
commit557d39be2a575c8a340ead48af2fc6e709d52a00 (patch)
tree5f0b3a62a1a0ff8eedf21d5f06ffab03dfac2785 /src/collectors/common-contexts
parentReleasing debian version 1.47.2-1. (diff)
downloadnetdata-557d39be2a575c8a340ead48af2fc6e709d52a00.tar.xz
netdata-557d39be2a575c8a340ead48af2fc6e709d52a00.zip
Merging upstream version 1.47.5.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/collectors/common-contexts')
-rw-r--r--src/collectors/common-contexts/mem.swap.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/collectors/common-contexts/mem.swap.h b/src/collectors/common-contexts/mem.swap.h
index 6d692ef3b..1c1b053d7 100644
--- a/src/collectors/common-contexts/mem.swap.h
+++ b/src/collectors/common-contexts/mem.swap.h
@@ -6,6 +6,14 @@ static inline void common_mem_swap(uint64_t free_bytes, uint64_t used_bytes, int
static RRDSET *st_system_swap = NULL;
static RRDDIM *rd_free = NULL, *rd_used = NULL;
+ if (free_bytes == 0 && used_bytes == 0 && st_system_swap) {
+ rrdset_is_obsolete___safe_from_collector_thread(st_system_swap);
+ st_system_swap = NULL;
+ rd_free = NULL;
+ rd_used = NULL;
+ return;
+ }
+
if(unlikely(!st_system_swap)) {
st_system_swap = rrdset_create_localhost(
"mem"