From 2ad61b867d458736bb1a4fa743177e1c6d8bcada Mon Sep 17 00:00:00 2001 From: Roman Martinuk Date: Fri, 12 Nov 2021 04:03:47 +0300 Subject: [PATCH] [Cache] Fix memory leak --- src/Symfony/Component/Cache/Traits/AbstractTrait.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Cache/Traits/AbstractTrait.php b/src/Symfony/Component/Cache/Traits/AbstractTrait.php index 2e7e2c89f6cbe..04660dcab9698 100644 --- a/src/Symfony/Component/Cache/Traits/AbstractTrait.php +++ b/src/Symfony/Component/Cache/Traits/AbstractTrait.php @@ -281,6 +281,10 @@ private function getId($key): string CacheItem::validateKey($key); $this->ids[$key] = $key; + if (\count($this->ids) > 1000) { + array_splice($this->ids, 0, 500); // stop memory leak if there are many keys + } + if (null === $this->maxIdLength) { return $this->namespace.$this->namespaceVersion.$key; } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy