K
K
KOS_MOS2011-09-15 15:31:58
PHP
KOS_MOS, 2011-09-15 15:31:58

PHP - Out of memory - where does the memory go?

There is a script that throws Out of Memory during operation - it is clear that somewhere something is not released.
How can you determine where? How can I see which variables take up how much memory space at the time of the error?
Xdebug help?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
I
Ivan Shalganov, 2011-09-15
@Aco

I recommend memtrack . Allows you to display line by line who ate what. If it's a cron, it's better to call the gc_collect_cycles collector instead . And check that the garbage collector is enabled at all.

P
Perkov, 2011-09-15
@Perkov

memory_get_usage but it will only show the memory usage.
unset() in the right place can do a lot.

A
Andrew, 2011-09-15
@Morfi

XDebug will help

D
Denis Medved, 2011-09-15
@BuCeFaL

Xdebug + KCachegrind + easy XDebug (firefox).

Q
Quiz, 2011-09-16
@Quiz

XDebug will help and a lot of luck.
First of all, I would pay attention to recursive functions and resource-intensive queries to the database.

J
jah, 2011-09-16
@jah

where does the memory go
to which cities
and where can we find a remedy...
:)
try digging here:
forum.dklab.ru/comments/nablas/45ProPerehvatIObrabotkuFatalnihOshibokFatalErrorVPhp.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question