Describe your environment
PHP 8.2.28, but this bug should not relevant with PHP version.
Steps to reproduce
After detached ContextStorageNode, it will reference itself as the previous node:
if ($this === $this->head->node) {
assert($this->previous !== $this);
$this->head->node = $this->previous;
$this->previous = $this;
return $flags;
}
Which cause circular reference to holding the memory.
What is the expected behavior?
Use WeakReference to avoid it.
if ($this === $this->head->node) {
assert($this->previous !== $this);
$this->head->node = $this->previous;
$this->previous = WeakReference::create($this);
return $flags;
}
What is the actual behavior?
Causing memory leak if we holding the process longer.
Additional context
Add any other context about the problem here.
Describe your environment
PHP 8.2.28, but this bug should not relevant with PHP version.
Steps to reproduce
After detached ContextStorageNode, it will reference itself as the previous node:
Which cause circular reference to holding the memory.
What is the expected behavior?
Use WeakReference to avoid it.
What is the actual behavior?
Causing memory leak if we holding the process longer.
Additional context
Add any other context about the problem here.