From 3bd74754c9200f5aa7f5bf5a93c621ee04f1e0a3 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Thu, 4 Jan 2018 14:30:28 +0100 Subject: [PATCH] lib: vrf_bitmap_groups increased from 8 to 1024 The number of vrf bitmap groups is increased so as to avoid consuming too much memory. This fix is related to a fork memory that occured when running pimd as daemon. A check on memory consumed shows that the memory consumed goes from 33480ko to 46888ko with that change. This is less compared to if the value of the bitmap groups is increased to 16 ( 852776ko). Signed-off-by: Philippe Guibert --- lib/vrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vrf.c b/lib/vrf.c index b4ed24cbff..2fa3a9c0ef 100644 --- a/lib/vrf.c +++ b/lib/vrf.c @@ -267,7 +267,7 @@ void *vrf_info_lookup(vrf_id_t vrf_id) * VRF bit-map */ -#define VRF_BITMAP_NUM_OF_GROUPS 8 +#define VRF_BITMAP_NUM_OF_GROUPS 1024 #define VRF_BITMAP_NUM_OF_BITS_IN_GROUP (UINT32_MAX / VRF_BITMAP_NUM_OF_GROUPS) #define VRF_BITMAP_NUM_OF_BYTES_IN_GROUP \ (VRF_BITMAP_NUM_OF_BITS_IN_GROUP / CHAR_BIT + 1) /* +1 for ensure */