my program get frozen

I suspect the sketch is hanging up in the I2C library waiting for an acknowledge from the I2C bus. This in turn is being caused by electrical noise on the I2C bus, this noise is from your servo.

The stock Arduino I2C library does not have a timeout on I2C transactions that would help prevent the freeze, but changing the library is not going to fix the root cause.

To test if this suspicion is correct see if the program runs fine with the servo completely disconnected.

Once the servo is shown to be the culprit, you need to reconnect the servo but power it from a more capable power source, perhaps a sepatate battery pack or power supply to isolate the noise from the Arduino, then control the sevo by connecting the pulse signal and 0V only to the arduino, and servo 0v and power to the separate power source.

There are other I2C libraries that have a timeout feature, but you need to fix the electrical noise problem as that is likely to be the root cause of the freeze.