Skip to content

Commit

Permalink
Remove out-of-date comments indicating default parameters.
Browse files Browse the repository at this point in the history
We sample less frequently.

PiperOrigin-RevId: 676989907
Change-Id: Iea0e5a285584bb586ec9df26ed2f21639806b262
  • Loading branch information
ckennelly authored and copybara-github committed Sep 20, 2024
1 parent 213ff60 commit 739c9ee
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions tcmalloc/sampler.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,14 @@ namespace tcmalloc_internal {
// Caller must use external synchronization if used
// from multiple threads.
//
// With 512K average sample step (the default):
// With 512K average sample step:
// the probability of sampling a 4K allocation is about 0.00778
// the probability of sampling a 1MB allocation is about 0.865
// the probability of sampling a 1GB allocation is about 1.00000
// In general, the probability of sampling is an allocation of size X
// given a flag value of Y (default 1M) is:
// given a flag value of Y is:
// 1 - e^(-X/Y)
//
// With 128K average sample step:
// the probability of sampling a 1MB allocation is about 0.99966
// the probability of sampling a 1GB allocation is about 1.0
// (about 1 - 2**(-26))
// With 1M average sample step:
// the probability of sampling a 4K allocation is about 0.00390
// the probability of sampling a 1MB allocation is about 0.632
// the probability of sampling a 1GB allocation is about 1.0
//
// The sampler works by representing memory as a long stream from
// which allocations are taken. Some of the bytes in this stream are
// marked and if an allocation includes a marked byte then it is
Expand Down

0 comments on commit 739c9ee

Please sign in to comment.