fix: avoid memory issues by doing better cleanup#4059
Merged
WilcoFiers merged 5 commits intodevelopfrom Jun 22, 2023
Merged
Conversation
straker
previously requested changes
Jun 20, 2023
lib/core/utils/get-selector.js
Outdated
| xhtml = isXHTML(document); | ||
| } | ||
| const xhtml = isXHTML(document); | ||
| console.log({ xhtml }); |
Contributor
There was a problem hiding this comment.
Suggested change
| console.log({ xhtml }); |
| @@ -1,3 +1,4 @@ | |||
| import caches from '../base/cache'; | |||
Contributor
There was a problem hiding this comment.
Any particular reason you called this caches?
test/checks/navigation/region.js
Outdated
| assert.isTrue(checkEvaluate.apply(checkContext, checkArgs)); | ||
| }); | ||
|
|
||
| it('should return true when the region was removed from standards', () => { |
Contributor
There was a problem hiding this comment.
Suggested change
| it('should return true when the region was removed from standards', () => { | |
| it('should return true when a region role is added to standards', () => { |
straker
approved these changes
Jun 21, 2023
Merged
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.
I went over the entire codebase looking for places where we're keeping variables we should clean up after a run. Probably the biggest one was in
querySelectorAllFilter, which was indicated as a problem in the issue. I found a few other places where info was stored in file scope where it shouldn't have been. Those have been fixed. There shouldn't be any of those left now.The issue indicated the biggest problem with in FrameMessenger's channels. That's not something we can put into the cache though. FrameMessenger isn't necessarily tied to a run, so we can't clear channels after the run is closed. What I've tried to do instead is move things around a bit so we don't set listeners unnecessarily. I don't know if that solves the issue, but then I'm not sure if this is even an issue. Even if it persisted, I don't think
channelsshould need to be all that big.An alternative could be that we put a timeout directly into FrameMessenger. If no response happens after a predetermined time, the handler is deleted and an error is thrown. That's a complicated change, so if we can avoid that I think I'd prefer that. We'll see if this does enough to solve the issue.
Closes: #4045