Pull request #3664: memory: use the process total instead of per thread totals to enforce cap
Merge in SNORT/snort3 from ~RUCOMBS/snort3:process_memory to master
Squashed commit of the following:
commit
3d3da0fd75a73eb43fd4aa6b7e8e252b9c6ea1ee
Author: Russ Combs <rucombs@cisco.com>
Date: Wed Jan 4 08:31:40 2023 -0500
memory: rename manager to overloads to better indicate purpose
commit
e343738e2b178002b7e8f63f60cdbe7c512499db
Author: Russ Combs <rucombs@cisco.com>
Date: Wed Jan 4 06:37:34 2023 -0500
memory: update developer notes
commit
7f374a318e87662c1d7766ffd237d65eb605f60f
Author: Russ Combs <rucombs@cisco.com>
Date: Wed Dec 28 09:01:20 2022 -0500
memory: update stats regardless of state; add unit tests
commit
71822045d1ed62da660573d2c82a5566ba42967d
Author: Russ Combs <rucombs@cisco.com>
Date: Tue Dec 27 09:33:34 2022 -0500
memory: delete unnecessary includes
commit
cc19d105f6b08a7071978de0681fdf840413967e
Author: Russ Combs <rucombs@cisco.com>
Date: Thu Dec 22 16:02:14 2022 -0500
memory: refactor jemalloc code and add relevant pegs
commit
7e30c6081c4fb0cac8c55658b50d5abfd14bc977
Author: Russ Combs <rucombs@cisco.com>
Date: Wed Nov 23 13:51:30 2022 -0500
build: exclude unused memory related sources
commit
fc74bce73bd0db2b4fd67872615fd3f0dbf0a916
Author: Russ Combs <rucombs@cisco.com>
Date: Wed Nov 23 12:21:38 2022 -0500
build: error out if both jemalloc and tcmalloc are configured
commit
0663095ec3344f97cb80a9291bda6ed675edd469
Author: Russ Combs <rucombs@cisco.com>
Date: Wed Nov 23 12:18:18 2022 -0500
memory: incorporate overloads into profiler
commit
7824486ad5799116da4c825d991fc3d9d8e2738f
Author: Russ Combs <rucombs@cisco.com>
Date: Thu Nov 10 14:03:23 2022 -0500
memory: use the process total instead of per thread totals to enforce cap
Since Snort doesn't always free memory in the thread that allocated it,
switch to a process cap enforcement strategy when using jemalloc. To get
updated stats.allocated it is necessary to bump the epoch, which can be
expensive, so it is done by the main thread once per interval ms. If
over limit, each packet thread will prune one flow per packet until the
prune_target is reached.