Use of global variables and its effect on encoder reading

Hello,

In my code on Arduino uno, for running wheeled robot, when my global variable usage was 29% motors ran well.
But as soon as my global variable usage got to 52%, motors did not run.

Can someone please help me to know whether global variables has effect on encoder reading.

Thanks in advance.

(deleted)