Site logo

Archived topic

GenerateBlocks causing memory leak and

13 replies · Started by Stefan on March 20, 2021

Viewing posts 1–14 of 14

Hi GeneratePress,

It seems that the GenerateBlocks (I guess it's part of GeneratePress?) is causing my website to crash.
My hosting provider shared the following info with me:

"Upon checking, we noticed the plugin "generateblocks" is causing memory leak, and downtime for the website. We have had to disable the plugin in order to minimize the impact and downtime for the website."

This happened after I made textual edits to one of the web pages. I was not installing or tweaking any type of code or plugins.

Could you please look into this issue? Currently the plugin is disabled.

Hi there,

We're not aware of/had any other reports of issues like this.

Do they have any more information they can share? Specific functions or error_logs that will allow us to investigate further?

Thanks!

Hi Tom,

This is the info I received, see private message.

Strange, I'm not able to reproduce the issue, and we haven't had any other reports. I wonder if there's something specific going on with this particular website. Does it happen on all pages, or only a single page?

Hi Tom,

Thank you for your help.

I renabled the plugin again. There was an issue with one of the spacer reusable blocks. I removed the reusable block and re-created it again. Maybe that was causing the issue.

We can close the issue for now and if it appears again, I will let you know.

Regards,
Stefan

Glad you got it sorted, thanks for letting me know :)

Hi Tom,

The memory leak was caused after I would receive the notification "the block cannot render in itself."
It's easier to explain in a video (to which I am providing the link below).

Once you get the chance, please let me know your thoughts on the issue of "blocks cannot rendering themselves" and the "breaking of reusable blocks".

Regards,
Stefan

Thanks for the video.

What's interesting here is that you're using core blocks - not GenerateBlocks. The spacer block and even the Buttons block you're using are both core blocks.

WordPress 5.7 completely changed how re-usable blocks work, so that's likely why it only just started happening.

However, it seems completely broken for you without a doubt - this is definitely not how it's working for most people.

What happens if you create a new test page and use nothing but core blocks? So add a "Group" block, then your re-usable buttons block (using the core buttons) - does the same issue happen?

Hi Tom,

I tried with a new page and used only core blocks. The default core blocks work fine. The problem arises when I introduce "re-usable blocks."

For some reason the re-usable blocks are showing the problem again "Block cannot be rendered inside itself" every time I insert re-usable blocks I created from the core blocks.

Maybe you can re-create the problem if you create a "re-usable" block and try to add re-usable blocks after or between two core blocks. This is when the issue occurs.

Please let me know once you have a chance to look into the problem.

Regards,
Stefan

Hi Stefan,

I've found the issue here. It happens when you add a re-usable inside of itself. So if you add "Re-usable block A" back inside "Reusable block A".

It's fixed in the next version, but you can make this change for now: https://github.com/tomusborne/generateblocks/commit/051f91e72df8bc343382deb158214f6c18260a2a

Once that fix is in place, the memory leak will cease, but the block will still be broken as WordPress doesn't allow blocks within themselves.

Hi Tom,

Thank you for the follow up. I am not sure how to make the change using the information you shared on GitHub or where I need to insert the code. Or this is going to be released with the next update of GenerateBlocks (in which case I would just need to update the plugin)?

The inconvenience is that when using "Re-usable blocks" it is possible to put them one inside the other, but it's not possible (at least I have not been able to do so inadvertently or advertently) for the core blocks.

Regards,
Stefan

Thanks for the video Elvin. Will try it and see if that works.

No problem. Let us know how it goes.

This archived topic is closed to new replies.