On Wed, 06 Jul 2016 15:06:20 +0000, James <[email protected]> wrote:
> Franz Fellner <alpine.art.de <at> gmail.com> writes:
>
>
> > I have issues with some prgrams eating too much memory. This seems to be
> > related to glibc not trimming as
> > necessary which results in way too much memory still occupied by the
> > program after free()ing memory.
>
> Perhaps you should file a bug, providing some evidence if other distros are
> affected (this suggests it might be a gcc issue) or other distros are not
> affected (this suggests it might be a gentoo pathch issue)?
I mentioned my issues several times with the answer "can't be, the issue is on
your side".
When I filed a bug against tmux regarding its memory consumption I got told
"glibc is known to do bad things" and I was given this patch for tmux which
instantenously solved my issue:
diff --git a/grid.c b/grid.c
index ef7c374..96385f4 100644
--- a/grid.c
+++ b/grid.c
@@ -113,6 +113,8 @@ grid_destroy(struct grid *gd)
free(gd->linedata);
free(gd);
+
+ malloc_trim(0);
}
/* Compare grids. */
@@ -326,6 +328,8 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny)
free(gl->celldata);
memset(gl, 0, sizeof *gl);
}
+
+ malloc_trim(0);
}
/* Move a group of lines. */
I have some other applications that are unusable to a certain degree. Having to
patch every single application isn't possible, I want to get to the root of the
issue :) And USE=vanilla is my first attempt.
Thx
Franz