Bug #80853 [NEW]: Apparent memory leak in PHP 8 not present in 7.4

From: Date: Wed, 10 Mar 2021 19:59:51 +0000
Subject: Bug #80853 [NEW]: Apparent memory leak in PHP 8 not present in 7.4
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-232652@lists.php.net to get a copy of this message
From:             zach at yembo dot ai
Operating system: Alpine Linux
PHP version:      8.0.3
Package:          Reproducible crash
Bug Type:         Bug
Bug description:Apparent memory leak in PHP 8 not present in 7.4

Description:
------------
Our product has an AWS SQS queue listener microservice that is an
infinite loop that long polls SQS and processes messages as they come
in. When using the php:7.4-fpm-alpine3.13 image from Docker Hub, the
code runs indefinitely with no issues. However, when running the exact
same application code using the php:8.0-fpm-alpine3.13 base image, we
are seeing Kubernetes kill the pod due to exhausting the upper memory
limit. 

We plotted the output of kubectl top pods over time, and found a long,
slow climb over the course of 3-4 hours until the pod reaches the memory
limit. Like many memory issues, I don't see any one smoking gun in the
code. Since the 7.4 image works ok, I suspect there is a memory leak
either introduced or exacerbated in PHP 8.

The codebase is fairly large and I'm not sure what particular area is
causing the issue. Does anyone have ideas on how to pinpoint or where to
look?

These links look generally related, but I'm not sure if there's any good
way to tell if this is the same issue we are facing: 

1. https://phabricator.wikimedia.org/T247990
2. https://bugs.php.net/bug.php?id=79519


-- 
Edit bug report at https://bugs.php.net/bug.php?id=80853&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80853&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80853&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80853&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80853&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80853&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80853&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80853&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80853&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80853&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80853&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80853&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80853&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80853&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80853&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80853&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80853&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80853&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#232652) next »