Help Debugging Memory Error Potentially Associated with CB Package Builder

1 year 3 months ago - 1 year 3 months ago #332455 by jamesmoeller
I'm hoping you might be able to provide some insight into memory errors I'm receiving with a Joomla 4 site that uses Community Builder, CB Package Builder, and CBSubs. I have a suspicion that the problem might be with the CBSubs Package Builder plugin (and possibly an interaction with Joomla 4) because I have a digital twin of this site and the only different is with the publishing of the CBSubs Package Builder plugin.

I've implemented the following.
Joomla latest version - 4.2.6
PHP version 8.0.27
-- PHP 8 "memory_limit" set to 512M.
Community Builder latest version - 2.7.4+build.2023.01.17.14.52.08.a35ed9e70
CB Package Builder latest version - 6.3.0+build.2023.01.11.18.12.27.d50855c72
CB Subs latest version - 4.6.1+build.2023.01.11.21.12.21.5746d49ef
Also has the latest version of Acymailing installed.

I have two twin sites on the same server that are configured identically as described above.
The current site on which I'm working is the development twin. The other twin is the live site.
The only difference is that the development site has a couple Package Builder downloads configured and has the "CBSubs Package Builder" plugin enabled, and occasionally receives memory errors. The live site does not have any Package Builder downloads configured and has the "CBSubs Package Builder" plugin unpublished. I've never received these memory errors on the live site.
Despite considerable effort, I've not yet been able to find a repeatable situation or sequence of configuration operations that trigger the memory error.
Sometimes the error occurs when doing random CB configuration operations. However, I've encountered the error more frequently when I click on Joomla Global Configurations or when I click on any option under Joomla >> System configuration. But again, nothing that is exactly repeatable. I see the error most frequently on the back-end, but have also seen a similar error on the front-end of the website.
When I reported this issue to my hosting provider, all they've said (so far) is that it looked like there was a Joomla php script (plugin) that was requesting 1G of memory during its execution. I'm working on getting more information from them on their diagnosis.

The specific error I'm seeing is the following.  Any insight is much appreciated.

Back-end
Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 82829536 bytes)
Exception
Symfony\Component\ErrorHandler\Error\ OutOfMemoryError
in /home/xxxxxx/public_html/libraries/vendor/maximebf/debugbar/src/DebugBar/DataFormatter/DataFormatter.php (line 41)
                $this->cloner->cloneVar($data),
                function ($line, $depth) use (&$output) {
                    // A negative depth means "end of dump"
                    if ($depth >= 0) {
                        // Adds a two spaces indentation to the line
                        $output .= str_repeat('  ', $depth).$line."\n";
                    }
                }
            );
            return trim($output);
Stack Trace 
OutOfMemoryError
Symfony\Component\ErrorHandler\Error\OutOfMemoryError:
Error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 82829536 bytes)
at /home/xxxxx/public_html/libraries/vendor/maximebf/debugbar/src/DebugBar/DataFormatter/DataFormatter.php:41 

Front-End
Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /home/xxxxxx/public_html/libraries/vendor/joomla/database/src/DatabaseDriver.php on line 1386

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 32768 bytes) in /home/xxxxx/public_html/libraries/vendor/symfony/error-handler/Exception/FlattenException.php on line 358

Fatal error: Allowed memory size of 536870912 bytes exhausted (tried to allocate 140505088 bytes) in Unknown on line 0

 

 

 
Attachments:

Please Log in to join the conversation.

1 year 3 months ago #332456 by jamesmoeller
After considerable additional experimenting, I believe I've found the cause of this memory error. It's associated with enabling "Debug System" within Joomla 4.

So, it turns out there was one additional difference between the twin sites. I had "Debug System" enabled via Global Configuration >> System >> Debug System - set to Yes (enabled), on the development site. I had enabled this along with Maximum error reporting (under the Server tab) in debugging a different problem.

I can't say that I know how Debug System is supposed to work, but it looks to me like there's a memory leak issue associated with that function that causes the php memory error.

Glad it only took 1 day to figure out. Hopefully posting here will save others time in the future.

 

Please Log in to join the conversation.

1 year 3 months ago #332463 by krileon
Debug mode consumes a lot of memory. CB Package Builder can also potentially consume a lot of memory on first scan of your filesystem if you have a lot of files for it to parse through, but you'd need thousands for that to happen or a very low memory limit.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.345 seconds

Facebook Twitter LinkedIn