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

Editor leaks memory after discarding post that contains media #20993

Closed
guarani opened this issue Jul 3, 2023 · 2 comments
Closed

Editor leaks memory after discarding post that contains media #20993

guarani opened this issue Jul 3, 2023 · 2 comments
Labels
Gutenberg Editing and display of Gutenberg blocks. Performance [Pri] High [Type] Bug

Comments

@guarani
Copy link
Contributor

guarani commented Jul 3, 2023

Expected behavior

Memory usage should go down after discarding a post.

Actual behavior

Memory usage stays high after discarding a post.

Steps to reproduce the behavior

  1. Create a new post
  2. Use the gallery block
  3. Add 50+ gifs/images

Additional information

@wargcm reported this in p1688047645788339/1688012020.214649-slack-C05CANZ2B6F, I haven't independently verified it yet.

Tested on device unknown, iOS version unknown, Jetpack iOS version unknown
@guarani guarani added [Type] Bug Performance Gutenberg Editing and display of Gutenberg blocks. labels Jul 3, 2023
@wargcm
Copy link
Contributor

wargcm commented Jul 13, 2023

I made a comment about this issue here: pcdRpT-3c3-p2#comment-5352. I'm going to copy parts of it here.

After following those steps in the issue, we can grab a memgraph object by:

  • ps aux | grep Jetpack.app to get the process ID
  • leaks <ID> --outputGraph=Jetpack to get Jetpack.memgraph

Then with this memgraph, we can run: leaks --referenceTree --groupByType Jetpack.memgraph > tree.txt

Here's a snippet of that output:

268199 (1043M) << TOTAL >>
      40369 (487M) Jetpack __DATA __bss: 'static AnimatedImageCache.cache' 0x1082fe650 --> <NSCache 0x2e7b981c0> [48]
      + 40368 (487M) _cache --> NSCache._cache (struct cache_s)
      +   40366 (487M) calloc in _value_entry_table_resize
      +   ! 13880 (149M) AnimatedImageWrapper
      +   ! : 12804 (149M) gifData + 8 --> Swift.DataStorage

This points to AnimatedImageCache holding onto this memory.

@kean
Copy link
Contributor

kean commented Jan 3, 2025

Closing because:

  1. AnimatedImageCache was removed in Feature Branch 25.7 #23923. The entire loading/caching infrastructure with a few minor exceptions was consolidated in one place.
  2. This is no longer relevant for the new editor that will run out of process

@kean kean closed this as completed Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. Performance [Pri] High [Type] Bug
Projects
None yet
Development

No branches or pull requests

4 participants