mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-23 12:31:07 +01:00
lib/workingsetcache: reset the cache mode when the cache is reset
This should reduce memory usage if the working set is reduced after the cache reset.
This commit is contained in:
parent
ae485c2bfd
commit
c25b839078
@ -6,6 +6,8 @@ sort: 15
|
||||
|
||||
## tip
|
||||
|
||||
* FEATURE: reduce memory usage when performing heavy queries over high number of time series.
|
||||
|
||||
* BUGFIX: remove `{ %space %}` typo in `/targets` output. The typo has been introduced in v1.62.0. See [this issue](https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1408).
|
||||
|
||||
|
||||
|
@ -218,6 +218,8 @@ func (c *Cache) Reset() {
|
||||
prev.Reset()
|
||||
curr := c.curr.Load().(*fastcache.Cache)
|
||||
curr.Reset()
|
||||
// Reset the mode to `split` in the hope the working set size becomes smaller after the reset.
|
||||
atomic.StoreUint64(&c.mode, split)
|
||||
}
|
||||
|
||||
// UpdateStats updates fcs with cache stats.
|
||||
|
Loading…
Reference in New Issue
Block a user