This program leaks non-RES memory, probably due to MAP_SHARED in the the mmap() reallocation. <code> #include <libgeom.h> int main() { while (1) { geom_stats_open(); geom_stats_close(); } return 0; } </code> # clang bug.c -lgeom && ./a.out
Created attachment 222869 [details] Don't leak memory in geom_stats_resync I classic memory leak. The attached patch fixes the problem. However, I think I'm going to do it a different way instead as part of https://reviews.freebsd.org/D28968, which also improves performance.
Fixed by ab63da3564e8ab0907f9d8eb565774848ffdadeb and MFCed by 2d1c164591ff5993cfca4b1190a345e40529593f and 8cfe6a4729f598d8a65d846a01184f1fabe2ebc7