|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80373 Memory leak in big array of strings
Submitted: 2020-11-16 01:27 UTC Modified: 2020-11-20 17:28 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: p30neo at gmail dot com Assigned: cmb (profile)
Status: Not a bug Package: Arrays related
PHP Version: 7.4.12 OS: CentOS 7
Private report: No CVE-ID: None
 [2020-11-16 01:27 UTC] p30neo at gmail dot com
There is Memory leak when we do any string operation in big loops with an array.

Test script:
Example 1 (Normal):
We have about 66 MB RAM Usage.
Example 2 (Memory leak):
here we get an error and It will use more than 128MB in this example.
(in example 2 : when we reexecute more times , the memory usage will dcreasing...)

Expected result:
I expected no memory usage diffrence between those two examples.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-20 17:28 UTC]
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2020-11-20 17:28 UTC]
The second script requires more memory, because there are
2,000,000 distinct "Lorem ipsum" strings.  For the first example,
the engine optimizes to only use only *one* "Lorem ipsum" string
(it is interned), and as such requires far less memory.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Jan 25 05:03:35 2022 UTC