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

Loading times and memory usage are too high #559

Open
MarcosHY opened this issue Mar 7, 2024 · 1 comment
Open

Loading times and memory usage are too high #559

MarcosHY opened this issue Mar 7, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@MarcosHY
Copy link

MarcosHY commented Mar 7, 2024

--- Is your feature request related to a problem? Please describe.
I am using this library to show downloaded images from the internet and stored in /storage/emulated/0/Android/data/com.appname/files. If the images are less than 1mb they work mostly fine, but on images of 3-15mb it is taking a lot of time to show, and with 5-10 seconds of autoPlay they don't even appear sometimes.

Another issue is that having around 7 images to add to the carousel the memory usage according to the AndroidStudio Profiler went from 280mb to 1,7gb more or less which caused the app to crash. I have started to use windowSize to 2 and 3 and it tops at 800mb now, which is still a lot.

--- Describe the solution you'd like
Render the images where they all appear much faster so there are no empty spaces in the slides, and memory optimisation where it doesn't increase by 500mb or 1gb when loading them.

--- Describe alternatives you've considered
Using windowSize and it works for the memory usage although it is still quite high, but the loading issues are still there.

--- Additional context
Versions used:

    "react-native-gesture-handler": "^2.15.0",
    "react-native-reanimated": "^3.7.2",
    "react-native-reanimated-carousel": "^3.5.1",

Here are screenshots of the Android Studio Profiler. The app is also playing other videos in high res or displaying other static images, but that barely affects the memory. The spikes are when a carousel appears and is snapping to the next items.


  • With no carousel and with a carousel showing a logo icon which is a few kb only:
Screen Shot 2024-03-07 at 12 23 39
  • With the original carousel without windowSize. Images of 5-15mb:

Screen Shot 2024-03-06 at 13 53 53


  • Same but with different windowSize values and optimised images of 3mb max:
Screen Shot 2024-03-06 at 13 34 25 Screen Shot 2024-03-06 at 13 39 34
@MarcosHY MarcosHY added the enhancement New feature or request label Mar 7, 2024
@MarcosHY
Copy link
Author

I have "solved" it by installing react-native-fast-image. The first time the images are shown it still goes high in memory, but the following times it barely changes and is around the 300-400mb mark.

Screen Shot 2024-03-13 at 19 48 28

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

No branches or pull requests

2 participants