Skip to content

Commit

Permalink
Set down MAX_NON_FREE_HAZARDS in conc::local to avoid unnecessari…
Browse files Browse the repository at this point in the history
…ly high memory usage.

In particular, hazards were laying around for an indefinite time, as they were never used again, yet were in a non-free state, blocking garbage collection of some garbage.
  • Loading branch information
ticki committed Jul 26, 2017
1 parent ab3c74d commit 4b8217f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion conc/src/local.rs
Expand Up @@ -143,7 +143,7 @@ impl State {
///
/// With "cleaning up" we mean setting the state of the hazards to "free" in order to allow
/// garbage collection of the object it is currently protecting.
const MAX_NON_FREE_HAZARDS: usize = 128;
const MAX_NON_FREE_HAZARDS: usize = 16;

// Push the given hazard to the cache.
self.available_hazards.push(hazard);
Expand Down

0 comments on commit 4b8217f

Please sign in to comment.