Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't see memory leack in memory dump #54

Open
Shkarbatov opened this issue Dec 28, 2017 · 9 comments
Open

Don't see memory leack in memory dump #54

Shkarbatov opened this issue Dec 28, 2017 · 9 comments

Comments

@Shkarbatov
Copy link

Hi, I have memory leack in my workers.

I have done memory_get_usage() on each iteration:
50183840
91469968
95433592
99533688
103630880
107729448
..
378392128

Also I have done memory dump by meminfo:
meminfo_dump(fopen('/home/dmitriy/phpmem/my_dump_file_'.$i.'.json', 'w'));

But when I compare files with 2 and 43 iteration almost nothing changed.

I attached two files fith 2 and 43 iteration.
https://drive.google.com/open?id=1amDpzmyIel0QWdYqZp64F-f5L5fisqvC

Any ideas, why I don't see anything?

@BitOne
Copy link
Owner

BitOne commented Dec 31, 2017

Hi @Shkarbatov ,

It's difficult to tell exactly what is happening. It could be one of the following reason:

@Shkarbatov
Copy link
Author

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.

@Shkarbatov
Copy link
Author

Shkarbatov commented Jan 2, 2018

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

@Shkarbatov
Copy link
Author

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.

@BitOne
Copy link
Owner

BitOne commented Jan 4, 2018

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) ?

@Shkarbatov
Copy link
Author

@Shkarbatov
Copy link
Author

In example there is Symfony\Component\Stopwatch\StopwatchPeriod, I disabled it and repeated script - result is the same.

@shxofficial
Copy link

Is there any update on this? i have the same situation but cannot solve it...

@BitOne
Copy link
Owner

BitOne commented Aug 6, 2018

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants