Hi Shengjie,
VMD is able to load short segment of the trajectory. You do not need to load the whole trajectory if the file is larger than the memory of your computer.
Since you have known the possible step point that the atom might move out of the box based on your own program (script), it is a good idea to check the trajectory around this point by using VMD.
For example, if the step point is the 23456th frame, you can only load 100 points before and after this frame. e.g. from 23356 to 23556. Please see the picture below on which the red box and ellipse indicating the key points you need to pay attention.
After loading the segment of your trajectory, you need to set the pbc box length and wrap the atoms as I suggested in the last response.
Visualization the results will help you check both the trajectory and your program (script).
Good luck.
Huan
.