Comments (9)
Hi @Shkarbatov ,
It's difficult to tell exactly what is happening. It could be one of the following reason:
- you didn't reach yet 10.000 items in the GC buffer, so the Garbage Collector didn't run yet (see https://speakerdeck.com/bitone/hunting-down-memory-leaks-with-php-meminfo to get more details on how PHP frees memory). Try to force the GC collection by calling gc_collect_cycles http://php.net/manual/en/function.gc-collect-cycles.php. PHP Meminfo records only "reacheable objects", so objects than can be collected by the GC, but not yet collected would not be seen by PHP Meminfo.
- sometimes a memory leak in PHP can comes from one of its extension. In this case, PHP Meminfo would not be able to see it because the items responsible for the leaks will not be part of the PHP program memory. This can be the case of buffered queries that get a lot of records. See http://php.net/manual/en/mysqlinfo.concepts.buffering.php for more information.
from php-meminfo.
you didn't reach yet 10.000 items in the GC buffer,
I try it with the GC:
gc_collect_cycles();
meminfo_dump(fopen('/home/dmitriy/phpmem/my_dump_file_'.$i.'.json', 'w'));
Result is the same.
from php-meminfo.
sometimes a memory leak in PHP can comes from one of its extension.
I understand this, but if I see difference in meminfo dump, isn't it's don't mean that I can see difference in meminfo?
For 2 iteration:
string - 30415 - 1271927
array - 16665 - 1199880
null - 6708 - 107328
boolean - 5667 - 90672
integer - 3025 - 48400
For 43 iteration:
string - 32970 - 1345086
array - 18103 - 1303416
null - 6720 - 107520
boolean - 5937 - 94992
integer - 3117 - 49872
from php-meminfo.
If XHProf show me, there is no any difference in memory between 2 and 43 iteration, but memory_get_usage() show that memory is rising. What it can be? GC run in each iteration.
from php-meminfo.
Maybe you have a small leak of PHP items that you can see in phpMeminfo and a big leak coming from an extension. Can you provide the two full dump files instead of the summaries (for your iterations 2 and 43) ?
from php-meminfo.
Adding dumps 3 and 389 iteration:
https://drive.google.com/drive/folders/1izeyMBlf85y09Or0BeCd70yfqE8_ygWb?usp=sharing
from php-meminfo.
In example there is Symfony\Component\Stopwatch\StopwatchPeriod, I disabled it and repeated script - result is the same.
from php-meminfo.
Is there any update on this? i have the same situation but cannot solve it...
from php-meminfo.
Hey @Shkarbatov and @shxofficial ,
Do you have any code that you could share so we can reproduce the issue?
By the way, I'm thinking of adding an option to dump the content of the strings. Would that be helpful for you?
from php-meminfo.
Related Issues (20)
- Header : signed integer overflow
- Invalid JSON for FFI objects HOT 1
- The frame label is not correct when there are more than two frames
- Segfault with PHP 7.4 due to https://github.com/BitOne/php-meminfo/pull/106 fix HOT 1
- segfault using it with swoole HOT 1
- Treemap Visualization of Heap Dump
- [Feature request] Allow to automatically create a dump on memory limit HOT 4
- Malformed UTF-8 characters, possibly incorrectly encoded HOT 2
- Please release a PHP 8-compatible version
- A way to diff two dumps HOT 1
- Odd behaviour resulting in SIGSEGV HOT 3
- New tag for PHP 8 ? HOT 1
- Wrong result with Fibers PHP 8.1
- Some zvals are missing in memory dump for classes with the __debugInfo magic.
- pthreads and meminfo HOT 1
- PHP 7.3 support HOT 3
- Provide a simpler view for the reference path
- PHPStorm stub HOT 1
- Memory leak not displayed in the dump HOT 6
- Make fails on PHP 7.3 in Linux HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-meminfo.