#89928Memory usage issue on CLI, caused by InMemoryLogWriter (adminpanel)
Description
I’ve registered a Symfony command in TYPO3 v9 to import products. After 1000 products I’ve experienced a memory usage of >500MB.
Thanks to XDebug, I’ve figured out what causes the memory leak: It’s the \TYPO3\CMS\Adminpanel\Log\InMemoryLogWriter registred in adminpanel extension.
When I put this to my extension’s ext_localconf.php:
if (PHP_SAPI === 'cli') {
unset($GLOBALS['TYPO3_CONF_VARS']['LOG']['writerConfiguration'][\TYPO3\CMS\Core\Log\LogLevel::DEBUG]);
}
the memory usage during full import stays below 50M.
—-
The full conversation can be seen here (including screenshots): https://typo3.slack.com/archives/C025BQLFA/p1576143741206100