Chromium Code Reviews

Issue 118126: Linux: stop libevent from pre-allocating huge arrays. (Closed)

Created:
11 years, 6 months ago by agl
Modified:
9 years, 7 months ago
Reviewers:
dank
CC:
chromium-reviews_googlegroups.com
Visibility:
Public.

Description

Linux: stop libevent from pre-allocating huge arrays. Currently, libevent allocates two structures of size RLIMIT_NOFILE (which is 8192 on Ubuntu) and so these end up being several hundred kB of memory for each MessageLoopIO. This patch changes the default size to 32. If the thread watches a file descriptor greater than 32, the arrays will be grown as needed, doubling each time.

Patch Set 1 #

Unified diffs Side-by-side diffs Stats (+2 lines, -12 lines)
M third_party/libevent/epoll.c View 3 chunks +2 lines, -12 lines 0 comments

Messages

Total messages: 2 (0 generated)
agl
11 years, 6 months ago (2009-06-02 19:45:24 UTC) #1
dank
11 years, 6 months ago (2009-06-02 20:16:08 UTC) #2
The description should mention the bug fix and link to the bug report you're
filing.
It should also mention that it's not upstream-quality because it strips
the solaris kludge.  (Maybe you could keep the solaris kludge by doing
a min rather than an =, and send this upstream?)

32 is so low that Chrome will reallocate that array quickly.
In fact, even browsing with
  ulimit -n 100
Chrome crashes pretty quickly.   ulimit -n 200 didn't crash in the ten
minutes I tried.  I suppose that doesn't matter, though.

Otherwise LGTM

Powered by Google App Engine