BitOne / php-meminfo

PHP extension to get insight about memory usage
MIT License
1.08k stars 78 forks source link

Mem leak not reported properly #64

Closed aftabnaveed closed 6 years ago

aftabnaveed commented 6 years ago

I have a long-running process (PHP-PM) executing laravel in a loop. I am seeing memory leaks in my application but the meminfo_dump seems to be not reporting it.

PHP Version: 7.1.2

Memory Leaks:

                                                                                                                      │ime (ms)
--- Worker 5501 stderr ---                                                                                             │  50%     24
11546560                                                                                                               │  66%     34
[24/May/2018:16:38:45 +0000] 172.19.0.9 - - "GET /catalog/product/view/id/34072 HTTP/1.0" 200 347109 "-"               │  75%     50
13175728                                                                                                               │  80%   1380
[24/May/2018:16:39:17 +0000] 172.19.0.9 - - "GET /catalog/product/view/id/34072 HTTP/1.0" 200 346935 "-"               │  90%   2856
14878304                                                                                                               │  95%  11978
[24/May/2018:16:42:07 +0000] 172.19.0.9 - - "GET /catalog/product/view/id/34072 HTTP/1.0" 200 346911 "-"               │  98%  17847
16796656                                                                                                               │  99%  22491
[24/May/2018:16:42:37 +0000] 172.19.0.9 - - "GET /catalog/product/view/id/34072 HTTP/1.0" 200 346889 "-"               │ 100%  30584 (longest request)

With each request it is adding around 2MB of memory and not releasing it. I generated the meminfo and it is reporting all well, here is the summary:

+---------+-----------------+-----------------------------+
| Type    | Instances Count | Cumulated Self Size (bytes) |
+---------+-----------------+-----------------------------+
| string  | 160             | 5788                        |
| boolean | 44              | 704                         |
| array   | 9               | 648                         |
| integer | 1               | 16                          |
| float   | 1               | 16                          |
+---------+-----------------+-----------------------------+

I do not see any objects listed there which sounds strange to me unless I am misinterpretting it :(

aftabnaveed commented 6 years ago

After compiling the open pull request from this issue https://github.com/BitOne/php-meminfo/issues/63 It now seems to be working and generating the report.