Is there a way to limit the pick files flow function to only allow picking files under a certain size?

The reason I ask is I am getting a crash occurring when app tries to pick files when the rest of the app is consuming enormous amount of the devices ram doing nothing but being open. I really do not understand why appgyver apps consume so much of a devices ram. It’s like 3 times what Facebook uses. But I’m just tying to catch the error, and there is no way to catch it after the file is picked. If we do not check the allocated memory the picking of the file is going to need first and check it against the amount available, the app will crash and there is nothing we can do to catch it.