matejkriz / react-native-today-widget

iOS Today Widget in React Native
Other
418 stars 24 forks source link

Memory usage too high? #5

Closed simonayzman closed 2 years ago

simonayzman commented 7 years ago

I can't seem to run the today widget on a device. I've tried creating my own today widget as well, and it seems to crash with an 'Unable to load' screen. This is likely because of too much memory usage. Does anyone have any insight into this?

sconnor-npr commented 7 years ago

@simonayzman I had the same issue. For whatever reason, I was able to finally get it running by profiling the widget in Xcode (Product > Profile).

simonayzman commented 7 years ago

Doesn't the profiler not listen to memory limits, so you can analyze beyond the limits?

matejkriz commented 7 years ago

Please check new note about memory limitation: https://github.com/matejkriz/react-native-today-widget#memory-limitation

You need to run the widget on device in Release mode and avoid memory-intensive operations.

I'm trying to investigate possibilities to optimize initial memory consumption, because it looks like the biggest obstacle for creating useful widgets.

MaxToyberman commented 6 years ago

@matejkriz @simonayzman , The new 1.0.0 version should fix it

simonayzman commented 6 years ago

@MaxToyberman So if you display a couple of <Image> components with web images, it wouldn't crash? Or if you make some sort of API call?

MaxToyberman commented 6 years ago

@simonayzman yes, it should work now, I have tested it with some images and it works fine, but the memory limitation still exists, you still can't exceed 16 MB.

simonayzman commented 6 years ago

That was still the issue before for me. The last version worked for me up until 16 MB, too. For my use case, it just won’t work probably.

MaxToyberman commented 6 years ago

@simonayzman did you try the new version ? do you have index.widget.js ?

simonayzman commented 6 years ago

Don't quite have the bandwidth to test it now, but regardless, this doesn't solve the fundamental issue that there's a very low memory limit. That's an Apple thing, and likely, won't change. 🤷‍♂️

MaxToyberman commented 6 years ago

@simonayzman I agree that there is a memory limit and thats an Apple thing, but the new version has a major improvement, now the widget code and the App code are in different files, and thery are not bundled together. I think it worth a try. before this change I couldn't add images also. but now works perfectly for me.