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

Memory leak when going from compress screen to home screen #1048

Closed
suiyuex opened this issue Jun 9, 2021 · 10 comments · Fixed by #1054
Closed

Memory leak when going from compress screen to home screen #1048

suiyuex opened this issue Jun 9, 2021 · 10 comments · Fixed by #1054
Assignees

Comments

@suiyuex
Copy link

suiyuex commented Jun 9, 2021

I don't know this is whether or not a bug
once start compress image process will greatly improve memory usage

any solution can reduce memoery usage or not?

as you can see I just opened the website
the tab take about 30mb of memory
image
When I upload a image about 1.8m, the memory is straight up, and then wait for compress done (using default options)
the memory is about 800mb
and then i close the website image editor, the memory is about 350mb usage, and cant no longer reduce
image
this is right or not? and there is a way to solve this or not? thank you guys

@suiyuex suiyuex changed the title Very high memory usage high memory usage Jun 9, 2021
@jakearchibald
Copy link
Collaborator

and then i close the editor

Do you mean closing the tab, or going back to the home screen?

@suiyuex
Copy link
Author

suiyuex commented Jun 15, 2021

@jakearchibald sorry, i am not clearly described, close the editor is close the image editor
this here
image

and i want to know the memory usage is normal? thanks.

@jakearchibald
Copy link
Collaborator

I can recreate this by:

  1. Go to squoosh.app
  2. Open the red panda image
  3. Click the X to go back to the homescreen
  4. GOTO 2

GPU memory usage increases by 100-200mb each time.

It doesn't happen when just changing compression settings, so I suspect it's related to the creation of <canvas>. It could be our bug, or Chromium.

@suiyuex
Copy link
Author

suiyuex commented Jun 15, 2021

Thanks for solving my doubts

@jakearchibald
Copy link
Collaborator

I couldn't recreate the issue in a simple reduced way (https://static-misc-3.glitch.me/canvas-memory-test/), so my gut feeling is the memory leak is our fault rather than chrome's.

@suiyuex
Copy link
Author

suiyuex commented Jun 15, 2021

I can recreate this by:

  1. Go to squoosh.app
  2. Open the red panda image
  3. Click the X to go back to the homescreen
  4. GOTO 2

GPU memory usage increases by 100-200mb each time.

It doesn't happen when just changing compression settings, so I suspect it's related to the creation of <canvas>. It could be our bug, or Chromium.

the 3 step is go back to the homescreen or go back to the page root route? im confused

@jakearchibald
Copy link
Collaborator

"Click the X" (the one in the top-left of your screenshot)

I'm tracking down memory leaks now…

@jakearchibald jakearchibald self-assigned this Jun 15, 2021
@suiyuex suiyuex changed the title high memory usage memory leak cause high memory usage Jun 15, 2021
@jakearchibald jakearchibald changed the title memory leak cause high memory usage Memory leak when going from compress screen to home screen Jun 15, 2021
@jakearchibald
Copy link
Collaborator

PR #1054

@jakearchibald
Copy link
Collaborator

Thanks for filing this issue! It identifed issues in both Squoosh and Chrome.

@suiyuex
Copy link
Author

suiyuex commented Jun 15, 2021

I also learned a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants