Answer the question
In order to leave comments, you need to log in
How to catch a memory leak?
There is a data import script whose memory consumption graph looks like this:
Although the algorithm is built on coroutines (each mini-peak is a new iteration), there is clearly a leak somewhere (or rather, someone fills the memory with side data). The problem is that the language is php 7.1, i.e. no obsolete xprof and memprof. Ideally, I would like to get a snapshot of all primitive zval containers at the beginning and at the very end, because such things are 146% affected by filling an array or string with data.
Any ideas?
Answer the question
In order to leave comments, you need to log in
It's hard to wang without code. It seems that in each iteration either a new variable is created and then not removed, or an element is added to the array, processed somehow, then the next element and so the array grows over time.
I looked at Dmitry's message and your comments - is it possible to find out the higher function that is above it? It's just logical that this piece of code will grow all the time, because There is a search of all values and naturally the processing takes place at a higher level - you need to look there :)
UPD: And what did xdebug actually do not please?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question