Maximum number of Image / FileImageSource File

Is there currently a limit of the number of <Image File="" /> and <MultiDensityImageSource><FileImageSource File="" /></MultiDensityImageSource> in a project?

It may sounds weird, but that’s what I am currently facing. My project have around 300 <Image File="" /> and <MultiDensityImageSource><FileImageSource File="" /></MultiDensityImageSource>. Whenever I try to add more, the project will fail to launch in preview, stucking at the “Loading Starting project…” screen. To make it running again, simply remove some random <Image File="" /> or <FileImageSource File="" /> in the project.

There are no compilation / runtime error messages. Log file don’t have any special messages. Tried uno clean.

Tested on 2 Mac OS X 10.11.5. Tested Fuse 0.21 and 0.20.3.

Ouch, sorry to hear about your issue Vicker,

There isnt a hard limit per-se but there are limitation on how much memory an app is reasonably allowed to use (especially when your app goes to the background).

Currently we don’t have a way to handle this automatically in an Each but it is on our roadmap. You will probably want to remove items that are offscreen but this is currently non trivial.

I will add this thread to the internal ticket though so it is not forgotten.

Thanks for asking

Thanks, Chris.

May I know approximately how much memory is allowed?

I checked my app design. Although the maximum number of Image shown in the Each can go beyond 300. When the app first launched, it only shows 20 and each JPEG is around 20KB. Adding on top some static multidensity icons (around 7). I guess all together it is hard to reach 1MB.

Is it possible that the limitation not only applies to runtime memory, but also the bundled assets?

Hi Chris,

My team tested the same code base on 2 Windows platform and it works great. Looks like it is a platform dependent issue.

If you wish, I can privately share our Git repository on GitHub to you to have a test.

Sorry for the slow response. Good to hear you made progress. I was under the assumption that this was a mobile/tablet issue, but by mentioning ‘Windows’ I’m wondering, is this was a desktop preview issue?

Hi Chris,

Sorry that I didn’t mention that the issue is related to “desktop preview”.

No worries,

There isnt a set limit to the Images allowed in an Each in the simulator.

As this is platform dependent then I think I will let the tool’s folks know that we could do with some extra stress testing on the desktop preview. It would be great to see your test.

Is it ok if I mark this as resolved? (as this is a more general long-term issue, rather than a bug in the strict sense)

Sure. No problem.

I recorded a video showing the problem, please feel free to pass it to the tool team. https://www.dropbox.com/s/8ozgy8nvl4f8f3y/fuse-image-issue.mp4?dl=0

Thanks, Chris.

Love it, thanks!

Anders suggested a workaround and it works perfectly. Just for others references.

The issue is related to the maximum number of files opened in OSX for fuse preview. The workaround is to increase the limit by typing the following in the terminal.

ulimit -n 2048