1 |
On Wed, 06 Jul 2016 15:06:20 +0000, James <wireless@×××××××××××.com> wrote: |
2 |
> Franz Fellner <alpine.art.de <at> gmail.com> writes: |
3 |
> |
4 |
> |
5 |
> > I have issues with some prgrams eating too much memory. This seems to be |
6 |
> > related to glibc not trimming as |
7 |
> > necessary which results in way too much memory still occupied by the |
8 |
> > program after free()ing memory. |
9 |
> |
10 |
> Perhaps you should file a bug, providing some evidence if other distros are |
11 |
> affected (this suggests it might be a gcc issue) or other distros are not |
12 |
> affected (this suggests it might be a gentoo pathch issue)? |
13 |
|
14 |
I mentioned my issues several times with the answer "can't be, the issue is on your side". |
15 |
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: |
16 |
|
17 |
diff --git a/grid.c b/grid.c |
18 |
index ef7c374..96385f4 100644 |
19 |
--- a/grid.c |
20 |
+++ b/grid.c |
21 |
@@ -113,6 +113,8 @@ grid_destroy(struct grid *gd) |
22 |
free(gd->linedata); |
23 |
|
24 |
free(gd); |
25 |
+ |
26 |
+ malloc_trim(0); |
27 |
} |
28 |
|
29 |
/* Compare grids. */ |
30 |
@@ -326,6 +328,8 @@ grid_clear_lines(struct grid *gd, u_int py, u_int ny) |
31 |
free(gl->celldata); |
32 |
memset(gl, 0, sizeof *gl); |
33 |
} |
34 |
+ |
35 |
+ malloc_trim(0); |
36 |
} |
37 |
|
38 |
/* Move a group of lines. */ |
39 |
|
40 |
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. |
41 |
|
42 |
Thx |
43 |
Franz |