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

java.lang.OutOfMemoryError Android Ram 1GB #13379

Closed
tanmynguyen opened this issue Apr 7, 2017 · 3 comments
Closed

java.lang.OutOfMemoryError Android Ram 1GB #13379

tanmynguyen opened this issue Apr 7, 2017 · 3 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@tanmynguyen
Copy link

Description

screen shot 2017-04-07 at 17 00 23

Hi Team.

Reproduction Steps and Sample Code

I see issue when view list image in android?

Solution

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:largeHeap="true"
android:theme="@style/AppTheme">

What needs to be done to address this issue? Ideally, provide a pull request with a fix.

Additional Information

  • React Native version: 0.42
  • Platform: Android
@mobinni
Copy link

mobinni commented Apr 12, 2017

Couple of questions:

  • Are you using the ListView to show images?
  • What are the dimensions and size of the images you're loading?

Setting up largeHeap does not necessarily solve your problem, it rather masks the problem of your application using a large amount of memory.

I would suggest upgrading to 0.43.2 and using FlatList with virtualization to clean up the memory of your listview. As well as look into what the sizes are of the images you are loading, because I've been able to load list views with 2 000 000 images through virtualization without memory issues

@tanmynguyen
Copy link
Author

Thanks @mobinni !

Are you using the ListView to show images?
--> No. I use ScrollView to show list image

What are the dimensions and size of the images you're loading?

screen shot 2017-04-13 at 16 35 47

@hramos
Copy link
Contributor

hramos commented Apr 25, 2017

Please use FlatList in this case.

@hramos hramos closed this as completed Apr 25, 2017
@facebook facebook locked as resolved and limited conversation to collaborators May 24, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

4 participants