On Thu, Jul 04, 2019 at 12:04:11PM +0000, Eric Wong wrote: > Mike Hommey <mh@xxxxxxxxxxxx> wrote: > > I'm puzzled by the fact writing objects is so much faster with 1 thread. > > I/O contention in the multi-threaded cases? > > "public-inbox-index" (reading from git, writing to Xapian+SQLite) > on a dev machine got slow because core count exceeded what SATA > could handle and had to cap the default Xapian shard count to 3 > by default for v2 inboxes. AFAICT, git doesn't write from multiple threads. > As for memory use, does git use the producer/consumer pattern > for malloc+free so free happens in a different thread from the > malloc? > > Because current versions of glibc gets pathological with that case > (but I have a long-term fix for it): > > https://public-inbox.org/libc-alpha/20180731084936.g4yw6wnvt677miti@dcvr/T/ > Only locklessinc malloc seemed OK in the IPC department > (But I haven't kept up with jemalloc, tcmalloc developments in years) Oh right, I forgot to mention: - I thought this memory usage thing was [1] but it turns out it was real memory usage. - glibc's mallinfo stores values as int, so it's useless to know how much memory was allocated when it's more than 4GB. - glibc's malloc_stats relies on the same int data, so while it does print "in use" data, it can't print values above 4GB correctly. - glibc has a malloc_stats function that, according to its manual page "addresses the deficiencies in malloc_stats and mallinfo", but while it outputs a large XML dump, it doesn't contain anything that looks remotely like the "in use" from malloc_stats. - So all in all, I used jemalloc to gather the "allocated" stats. Mike 1. https://sourceware.org/bugzilla/show_bug.cgi?id=23416