Add closing of Page#25
Open
aayusharyan wants to merge 7 commits intosPavl0v:masterfrom
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Adding closing of Page for each render because some OS does not do automatic garbage collection and keeps the Chrome tabs open in the background causing heavy memory consumption and eventual failure.
Situation:
I am using this to render a little bit over 450 pages using GitHub action. With the current code, it takes 2.5 hours and crashes after rendering around 250 pages. (That means, in Github Action runner, all these 250 tabs are opening in parallel and causing this crash).

The error this runner throws is this.

The reason for this lost connection is basically the runner went out of memory and wasn't even able to update the status to Github about this job.
Fix:
Close the tab after rendering of html is completed. After this change, the runner is able to complete the job in less than 10 minutes to render the whole set of 450 pages without breaking a sweat.

The base build takes around 5-6 minutes, the spa-pre-render is a post build step. So, total job completes in 15 mintues, around 5-6 minutes to build, which means, this is able to complete the rendering in less than 10 minutes for 450+ pages.
Conclusion:
Adding the page.close will help in better memory management of chrome tabs and not depend on the host OS garbage collector.