Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discarding message for event 0 because of too many unprocessed messages in Xcode 8

Whenever the “discarding message” log comes, my app becomes unresponsive. It doesn’t crash, but doesn’t respond to touches either. As if all touch handling stops after my app goes to back ground , and 2~3 min later when my app goes to fore ground and touch menu , there is no response, and then few min later it dose work

like image 346
Balaji Avatar asked Jan 05 '17 06:01

Balaji


2 Answers

These messages are coming from Core Location framework. This implies that the CLLocationManager wasn't created on the main thread.

Is it related to app unresponsive?

Yes. When it goes into background mode after sometime app will be unresponsive.

like image 160
Balaji Avatar answered Sep 21 '22 17:09

Balaji


I was facing exactly the same behavior. This is what I noticed some time after I arrived here.

My first guess was a memory leak or maybe some missing thread but I used this answer to notice that my CPU was blowing up.

Then I tracked the method that was using all the CPU, in my case It was a validation on a UITextField via regex. After some research I realized that I was having a catastrophic backtrack. I improved my regex and everything goes well.

I hope this answer would help anyone that arrive here.

like image 20
Fernando Valenzuela Avatar answered Sep 20 '22 17:09

Fernando Valenzuela