On iOS, loading many assets in AssetMode::Processed
causes some assets to fail to load
#14542
Labels
A-Assets
Load files from disk to use for things like images, models, and sounds
C-Bug
An unexpected or incorrect behavior
O-iOS
Specific to the iOS mobile operating system
S-Needs-Investigation
This issue requires detective work to figure out what's going wrong
Bevy version
0.14.0
Relevant system information
iOS 17.5.1
What you did
Loaded 128 images all at once with
AssetMode::Processed
in iOS. The images aren't preprocessed, they're just configured to be copied intoimported_assets
.What went wrong
5 of the assets failed to load with
�[2m2024-07-30T19:31:05.814567Z�[0m �[31mERROR�[0m �[2mbevy_asset::server�[0m�[2m:�[0m Encountered an I/O error while loading asset: Too many open files (os error 24)
.Additional information
I tracked the loading states of the asset with logging:
This issue doesn't occur in
AssetMode::Unprocessed
with 512 images. I haven't tested with more than that. I suspect there's already a mechanism in Bevy that prevents too many assets from loading all at once, but it doesn't take into account.meta
files.Behold, a repro: https://github.com/Seldom-SE/testetst/blob/279fa27a26bf0b845a5558a815c1f8d031c26fa2/src/lib.rs It's based on
bevy_mobile_example
. To run it:./copy_assets.sh
. This just copies the one image 127 times.cargo run --features preprocess
The text was updated successfully, but these errors were encountered: