Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It looks like memory leaks tests are broken again #1731

Closed
jodator opened this issue Apr 26, 2019 · 10 comments · Fixed by #7351
Closed

It looks like memory leaks tests are broken again #1731

jodator opened this issue Apr 26, 2019 · 10 comments · Fixed by #7351
Assignees
Labels
type:bug This issue reports a buggy (incorrect) behavior.

Comments

@jodator
Copy link
Contributor

jodator commented Apr 26, 2019

The first occurence of master-revision CI started to fail today: https://travis-ci.org/ckeditor/ckeditor5-editor-classic/jobs/524842961. The previous one is OK: https://travis-ci.org/ckeditor/ckeditor5/builds/523466495.

It looks like Chrome introduces some changes as previos Jobs were executed on Chrome 73.x and the failing one is on Chrome 74.x.

I've tested locally and all previous builds on master-revisions branch fails locally.

@jodator jodator added the type:bug This issue reports a buggy (incorrect) behavior. label Apr 26, 2019
@mlewand mlewand added this to the iteration 24 milestone Apr 26, 2019
@mlewand
Copy link
Contributor

mlewand commented Apr 26, 2019

To mitigate the issue for CI it make sense to temporarily use Chrome 73.x until this issue is resolved. Meanwhile this issue should be fixed asap. Once done we'll restore the latest Chrome version on our CI.

@pomek

@pomek
Copy link
Member

pomek commented Apr 26, 2019

https://docs.travis-ci.com/user/chrome

[…] you can’t select a specific numeric version.

So we need to find an image (archive), download it on CI and install Chrome from it. And this change must be done in all repositories.

@mlewand
Copy link
Contributor

mlewand commented Apr 26, 2019

All right so ignoring the test sounds like a simpler idea, thanks for checking that.

@jodator
Copy link
Contributor Author

jodator commented Apr 26, 2019

My findings so far:

  • removing all plugins but Essentials from ArticlePlugin set make tests pass (but it might be due to the fact of low number of features)
  • removing toolbar (or even UI) from the editor (commenting out in base editor classes) also made the tests pass (but the reason might be similar)

I have a weird feeling that either Chrome messed something because I couldn't find any obvious leak (like detached event listeners). Also some retainers looks like webpack-related stuff - but again I didn't find anything that I'd be 100% sure about.

pomek pushed a commit to ckeditor/ckeditor5-core that referenced this issue Apr 29, 2019
mlewand added a commit to ckeditor/ckeditor5-core that referenced this issue Apr 30, 2019
@mlewand
Copy link
Contributor

mlewand commented Apr 30, 2019

Ok, for the time being the test were ignored with ckeditor/ckeditor5-core#172.

@mlewand
Copy link
Contributor

mlewand commented May 8, 2019

@jodator for the time being please prioritize #1490 over this issue for the time being. We'd like to have this feature as soon as possible, while issue with Chrome's gc API already took some time and we would be able to resume to it once #1490 is ready for the review.

It's ok to push it to iteration 25th if we can't do it within this iteration.

@jodator
Copy link
Contributor Author

jodator commented Jun 6, 2019

I was investigating this issue for a while and I have mixed feelings.

I've started with Chrome 74 and running automated tests gave me some positive results (decreased "memory consumption" in those tests). Yesterday or day before the Chrome was updated to version 75 and it looked like the tests just went green on master (without my previous "fixes"). I've started to debug those issues and I cannot create a repeatable environment for tests.

Anyway my observation are:

  • there are no leaks in current Chrome as far as I can test it manually
  • we have to implement CKEditor5 inspector removal for those manual memory tests in order to test it reliably
  • logging anything from the editor (which can hold reference back to the editor) will leak memory - ie console.log( editor.plugins ) will hold editor instance in the memory until the console is cleared.

I'm holding this issue to the end of iteration and will get to this later.

@mlewand mlewand modified the milestones: iteration 25, iteration 26 Jun 28, 2019
@jodator
Copy link
Contributor Author

jodator commented Jul 1, 2019

@Reinmar, unfortunately, it looks like the memory tests are still unreliable. I'm not sure if we're going to be able to have something stable enough for automatic testing.

@mlewand mlewand modified the milestones: iteration 26, nice-to-have Jul 29, 2019
@jodator
Copy link
Contributor Author

jodator commented May 21, 2020

I've revived the tests on memory-test branch. So far so good. I'd like to see if we have any false negatives there. The situation might get improved as we recently fixed some issues.

@jodator
Copy link
Contributor Author

jodator commented Jun 10, 2020

It would be nice to use performance.measureMemory() (now as a trial in Chrome 83) - but it requires a special flag to enable it as it is not released yet. Edit - it's trial ends on September this year so might not be feasible to use that yet.

mlewand added a commit that referenced this issue Jun 17, 2020
@mlewand mlewand modified the milestones: nice-to-have, iteration 33 Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants