mirror of
https://github.com/tmux/tmux.git
synced 2025-03-29 02:08:48 +00:00
malloc_trim is itself very poor and gets slower and slower as the heap becomes
more fragmented. Run it only once an hour. GitHub issue 2551.
This commit is contained in:
parent
12cfd0d22b
commit
ef9700816f
3
grid.c
3
grid.c
@ -265,9 +265,6 @@ grid_free_lines(struct grid *gd, u_int py, u_int ny)
|
|||||||
|
|
||||||
for (yy = py; yy < py + ny; yy++)
|
for (yy = py; yy < py + ny; yy++)
|
||||||
grid_free_line(gd, yy);
|
grid_free_line(gd, yy);
|
||||||
#ifdef HAVE_MALLOC_TRIM
|
|
||||||
malloc_trim(0);
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create a new grid. */
|
/* Create a new grid. */
|
||||||
|
4
server.c
4
server.c
@ -159,6 +159,10 @@ server_tidy_event(__unused int fd, __unused short events, __unused void *data)
|
|||||||
|
|
||||||
format_tidy_jobs();
|
format_tidy_jobs();
|
||||||
|
|
||||||
|
#ifdef HAVE_MALLOC_TRIM
|
||||||
|
malloc_trim(0);
|
||||||
|
#endif
|
||||||
|
|
||||||
log_debug("%s: took %llu milliseconds", __func__, get_timer() - t);
|
log_debug("%s: took %llu milliseconds", __func__, get_timer() - t);
|
||||||
evtimer_add(&server_ev_tidy, &tv);
|
evtimer_add(&server_ev_tidy, &tv);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user