Bug #76883 [Com]: After creating every 1024th objects php not freeing up all memory
| From: | toma dot zoltan at bitninja dot io | Date: | Sun, 16 Sep 2018 14:16:08 +0000 |
| Subject: | Bug #76883 [Com]: After creating every 1024th objects php not freeing up all memory | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-217079@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=76883&edit=1
ID: 76883
Comment by: toma dot zoltan at bitninja dot io
Reported by: toma dot zoltan at bitninja dot io
Summary: After creating every 1024th objects php not freeing
up all memory
Status: Duplicate
Type: Bug
Package: Performance problem
Operating System: any
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Thank you for your reply. Tried to find similar issues, but missed 33487 ticket.
Is there any way in cli enviroment to free all unused memory? (Beside restarting the process).
Sometimes a process, which runs one or two week in a row can consume 500+ MB of RAM.
Previous Comments:
------------------------------------------------------------------------
[2018-09-16 06:55:21] nikic@php.net
Duplicate of bug #33487.
The object store will use 8 bytes * next_power_of_two(max_number_of_objects_alive_at_the_same_time).
Because object store buckets are reused when objects are destroyed, you usually do not need to worry
about this. It's a one-time cost of creating many objects, not a leak that will be incurred for
every object.
------------------------------------------------------------------------
[2018-09-14 14:56:59] toma dot zoltan at bitninja dot io
Description:
------------
I have a long running daemon script, which could create thousands of object every 5 minutes. I tried
to free them, but memory was still used by the process.
An example script: https://3v4l.org/5ap4Z
It doesn't matter if class is empty. Or one or multiple class instances are used by the test.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=76883&edit=1