Answer the question
In order to leave comments, you need to log in
Why does the native php engine use so much RAM?
There is a self-written php engine that consumes 30 MB of memory (the site itself is rather big). Moreover, the more functions I have in the func.php file (which is included), the more it affects memory consumption.
PHP includes are known to consume a lot of memory. But how does WordPress solve these problems? The same site in terms of structure on the WP-engine consumes 20-25 mb. But WP has a lot more includes and even more functions in functions.php.
Answer the question
In order to leave comments, you need to log in
Скорее всего - проблема в многократном создании объектов класса без уничтожения тех, которые уже не нужны.
Но правильнее, будет использовать один экземпляр такого класса, поддерживающего многомерную структуру (дерево, стек и т.д.) с клонированием объектов внутри самого класса. Это значительно экономит память на выделение для каждого нового создаваемого подобного объекта класса.
+1 for profiling.
But I can also add that look at autoload, it can help stackoverflow.com/questions/4737199/autoloader-for...
It can be anything, the optimizer is disabled, etc.)
In WP, by the way, there are many classes.
Moreover, the more functions I have in the func.php file (which is included)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question