EV3 brick freeze during run big program
My kids have this exact same problem when a program reaches a certain size.  Parts of the program that previously worked just fine begin to systematically cause the brick to lock up.  We have found, as ridiculous as this sounds, the simple act of adding a variable read immediately before the motor block which seems to cause the brick to lock up will fix the problem.