glibc's malloc is very bad about returning memory from the kernel, add a call

to its malloc_trim to prompt it to do so. Reported by Sarunas Valaskevicius.
This commit is contained in:
Nicholas Marriott
2020-10-06 08:18:42 +01:00
parent 847a061e31
commit 680e7a382f
3 changed files with 32 additions and 0 deletions

3
grid.c
View File

@ -265,6 +265,9 @@ grid_free_lines(struct grid *gd, u_int py, u_int ny)
for (yy = py; yy < py + ny; yy++)
grid_free_line(gd, yy);
#ifdef HAVE_MALLOC_TRIM
malloc_trim(0);
#endif
}
/* Create a new grid. */