One of the first things in the boot up sequence is to check the available memory. Do you have more than one stick? Can you try booting it with alternate sticks? Can you beg/borrow a different one to try? That way you can rule out a memory problem.
Xiaomi Mi5s review: The Xiaomi flagship that could replace your Samsung, LG, HTC or Apple phone