mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00: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
2 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,8 @@ sort: 15
|
||||||
|
|
||||||
## tip
|
## 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).
|
* 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()
|
prev.Reset()
|
||||||
curr := c.curr.Load().(*fastcache.Cache)
|
curr := c.curr.Load().(*fastcache.Cache)
|
||||||
curr.Reset()
|
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.
|
// UpdateStats updates fcs with cache stats.
|
||||||
|
|
Loading…
Reference in a new issue