From f90bf8ae2a38c12792e250791b724a8b3644cacc Mon Sep 17 00:00:00 2001 From: Balint Reczey Date: Fri, 27 Jun 2014 17:36:32 +0200 Subject: [PATCH] Increase space allocated for IO Graph slower after 1 million items Change-Id: I691070b572e519f412a80db5d7415331f07e8e50 Reviewed-on: https://code.wireshark.org/review/2689 Reviewed-by: Graham Bloice Reviewed-by: Balint Reczey --- ui/gtk/io_stat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/gtk/io_stat.c b/ui/gtk/io_stat.c index 1e12746bc7..fe911c6942 100644 --- a/ui/gtk/io_stat.c +++ b/ui/gtk/io_stat.c @@ -270,7 +270,9 @@ tap_iostat_packet(void *g, packet_info *pinfo, epan_dissect_t *edt, const void * if (idx + 1 > io->num_items) { if (idx + 1 > io->space_items) { /* reallocate graphs */ - const gsize new_size = exp2(log2(idx + 1) + 1); + static const gsize exp_inc_limit = 1000000; + static const gsize step = 100000; + const gsize new_size = (idx < exp_inc_limit)?exp2(log2(idx + 1) + 1):(idx + step); if (io->space_items == 0) { /* nothing allocated yet */ int i;