This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug malloc/1128] Malloc not trimming filled-up sbrk space causes unnecessary system call overhead
- From: "neleai at seznam dot cz" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 16 Oct 2013 16:52:05 +0000
- Subject: [Bug malloc/1128] Malloc not trimming filled-up sbrk space causes unnecessary system call overhead
- Auto-submitted: auto-generated
- References: <bug-1128-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=1128
Ondrej Bilka <neleai at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |neleai at seznam dot cz
--- Comment #8 from Ondrej Bilka <neleai at seznam dot cz> ---
Does following patch fixes performance for you? I want to be sure that problem
was in sbrk but not in something else.
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 2938234..ab6d46f 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -2716,6 +2716,10 @@ static int systrim(size_t pad, mstate av)
char* current_brk; /* address returned by pre-check sbrk call */
char* new_brk; /* address returned by post-check sbrk call */
size_t pagesz;
+ static int give_up;
+
+ if (give_up)
+ return 0;
pagesz = GLRO(dl_pagesize);
top_size = chunksize(av->top);
@@ -2762,7 +2766,8 @@ static int systrim(size_t pad, mstate av)
return 1;
}
}
- }
+ } else
+ give_up = 1;
}
return 0;
}
--
You are receiving this mail because:
You are on the CC list for the bug.