Without the full codes, we can only guess. My guess would be the serial
receive buffer on the Arduino is overflowing.
One reason this could happen is if serialEvent() is not called
frequently enough. This function is called by the Arduino core on every
loop iteration, just after loop() returns. If your loop() takes too
long (e.g. you are using delay() or ...