Seen on one of my systems:
     92667 as-set elements in 64963 tables using -22.5M of memory
    339029 prefix-set elements using 14.0M of memory
RIB using 401M of memory
Sets using -8.5M of memory

Now there is no such thing as negative memory so there is an accounting
error. Looking at the code I noticed that I missed to account the inital
allocation.

OK?
-- 
:wq Claudio


Index: rde_sets.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde_sets.c,v
retrieving revision 1.6
diff -u -p -r1.6 rde_sets.c
--- rde_sets.c  26 Oct 2018 16:53:55 -0000      1.6
+++ rde_sets.c  5 Jan 2019 11:17:55 -0000
@@ -127,6 +127,7 @@ set_new(size_t nmemb, size_t size)
 
        rdemem.aset_cnt++;
        rdemem.aset_size += sizeof(*set);
+       rdemem.aset_size += set->size * set->max;
        return set;
 }
 

Reply via email to