Skip to content

Commit

Permalink
Use the right fd estimates
Browse files Browse the repository at this point in the history
  • Loading branch information
rocallahan committed Jul 27, 2024
1 parent 399aa6f commit e293422
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2344,10 +2344,10 @@ static struct rlimit initial_fd_limit;
static struct rlimit initial_memlock_limit;

void raise_resource_limits() {
// We need up to 5 perf event counters per tracee task
initial_fd_limit = raise_resource_limit(RLIMIT_NOFILE, 1024 + 5 * MAX_TRACEE_TASKS);
// We typically need one page of locked memory per tracee task
initial_memlock_limit = raise_resource_limit(RLIMIT_MEMLOCK, page_size() * 2 * MAX_TRACEE_TASKS);
// We need up to 7 perf event counters per tracee task
initial_fd_limit = raise_resource_limit(RLIMIT_NOFILE, 1024 + 7 * MAX_TRACEE_TASKS);
// We may need one page of locked memory per tracee task
initial_memlock_limit = raise_resource_limit(RLIMIT_MEMLOCK, page_size() * 1 * MAX_TRACEE_TASKS);
}

void restore_initial_resource_limits() {
Expand Down

0 comments on commit e293422

Please sign in to comment.