IP Library › Granted Patent US 12,450,116
Granted Patent B2
US 12,450,116 · App. 18/256,954 · Granted Oct 21, 2025

Method and apparatus for detecting application freezing problem, and device and storage medium

Inventors: Yadong Feng (Beijing, CN); Kunlun Bai (Beijing, CN)
Assignee: BEIJING BYTEDANCE NETWORK TECHNOLOGY CO., LTD.
G06F11/0793G06F11/079
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,450,116
App. No.
18/256,954
Granted
Oct 21, 2025
Kind
B2
Abstract

The present disclosure relates to a method, and apparatus for detecting an application freezing problem, and a device and a storage medium. The method comprises: detecting time consumed for a Runloop in a first thread of an application executing a task; when it is detected that the consumed time reaches a preset threshold value, at least acquiring a call stack of the first thread and the current first execution state of the Runloop, and writing the call stack into a preset file; detecting an execution state of the Runloop after the time consumed for the task reaches the preset threshold value; and if the Runloop does not enter a second execution state after the first execution state before the application is closed, sending the preset file to a remote server. By means of the solution provided in the embodiments of the present disclosure, an application freezing problem can be identified and detected.

Claims (57)

1. A method for monitoring application freezing problem, comprising:

monitoring time consumption for executing a task by a message loop mechanism (Runloop), in a first thread of an application, wherein the application is an application carried in an iOS system;

acquiring a call stack of the first thread and a current first execution state of the Runloop, in a case that it is monitored that the time consumption reaches a preset threshold;

monitoring an execution state of the Runloop after the time consumption reaches the preset threshold; and

sending the call stack of the first thread to a remote server, in a case that the Runloop does not enter a second execution state after the first execution state until the application is closed.

2. The method according to claim 1 , further comprising:

writing the call stack of the first thread into a preset file,

wherein the sending the call stack of the first thread to the remote server comprises:

sending the preset file to the remote server.

3. The method according to claim 1 , wherein the monitoring the time consumption for executing the task by the Runloop in the first thread of the application comprises:

pausing a timing for the time consumption for executing the task by the Runloop in the first thread of the application, in response to monitoring that the application is suspended; and

resuming the timing for the time consumption for executing the task by the Runloop in the first thread of the application, in response to monitoring that the application resumes running.

4. The method according to claim 2 , wherein in the case that it is monitored that the time consumption reaches a preset threshold, the method further comprises:

acquiring a call stack of at least one second thread of the application, and writing the call stack of the at least one second thread into the preset file.

5. The method according to claim 2 , wherein the acquiring the call stack of the first thread comprises:

periodically acquiring the call stack of the first thread at a preset first time interval; and

the writing the call stack of the first thread into the preset file comprises:

writing the periodically acquired call stack of the first thread into the preset file.

6. The method according to claim 5 , further comprising:

in a case that the number of call stacks recorded in the preset file is greater than a preset number, retaining the preset number of call stacks acquired last in an acquisition order of call stacks recorded in the preset file, and deleting other call stacks.

7. The method according to claim 1 , wherein before the sending the call stack of the first thread to the remote server, in the case that the Runloop does not enter a second execution state after the first execution state until the application is closed, the method further comprises:

writing the time consumption for executing the task by the Runloop into the preset file.

8. The method according to claim 2 , further comprising:

deleting the call stack recorded in the preset file, in a case that it is monitored that the execution state of the Runloop enters the second execution state after the first execution state.

9. A terminal device, comprising:

a processor;

a memory, configured to store a computer program;

wherein the computer program, when executed by a processor, causes the processor to monitor time consumption for executing a task by a message loop mechanism (Runloop), in a first thread of an application, wherein the application is an application carried in an iOS system;

acquire a call stack of the first thread and a current first execution state of the Runloop, in a case that it is monitored that the time consumption reaches a preset threshold;

monitor an execution state of the Runloop after the time consumption reaches the preset threshold; and

send the all stack of the first thread to a remote server, in a case that the Runloop does not enter a second execution state after the first execution state until the application is closed.

10. A non-transitory computer readable store medium storing a computer program thereon, wherein the computer program, when executed by a processor, causes the processor to:

monitor time consumption for executing a task by a message loop mechanism (Runloop), in a first thread of an application, wherein the application is an application carried in an iOS system;

acquire a call stack of the first thread and a current first execution state of the Runloop, in a case that it is monitored that the time consumption reaches a preset threshold;

monitor an execution state of the Runloop after the time consumption reaches the preset threshold; and

send the call stack of the first thread to a remote server, in a case that the Runloop does not enter a second execution state after the first execution state until the application is closed.

11. The method according to claim 4 , wherein the acquiring the call stack of at least one second thread of the application, and writing the call stack of the at least one second thread into the preset file comprises:

periodically acquiring the call stack of the at least one second thread of the application at the preset first time interval, and writing the periodically acquired call stack of the at least one second thread into the preset file.

12. The terminal device according to claim 9 , wherein the computer program, when executed by a processor, causes the processor to:

write the call stack of the first thread into a preset file; and

send the preset file to the remote server.

13. The terminal device according to claim 9 , wherein the computer program, when executed by a processor, causes the processor to:

pause a timing for the time consumption for executing the task by the Runloop in the first thread of the application, in response to monitoring that the application is suspended; and

resume the timing for the time consumption for executing the task by the Runloop in the first thread of the application, in response to monitoring that the application resumes running.

14. The terminal device according to claim 12 , wherein the computer program, when executed by a processor, causes the processor to:

acquire a call stack of at least one second thread of the application and write the call stack of the at least one second thread into the preset file, in the case that it is monitored that the time consumption reaches the preset threshold.

15. The terminal device according to claim 12 , wherein the computer program, when executed by a processor, causes the processor to:

periodically acquire the call stack of the first thread at a preset first time interval; and

write the periodically acquired call stack of the first thread into the preset file.

16. The terminal device according to claim 15 , wherein the computer program, when executed by a processor, causes the processor to:

in a case that the number of call stacks recorded in the preset file is greater than a preset number, retain the preset number of call stacks acquired last in an acquisition order of call stacks recorded in the preset file, and delete other call stacks.

17. The terminal device according to claim 14 , wherein the computer program, when executed by a processor, causes the processor to:

periodically acquire the call stack of the at least one second thread of the application at the preset first time interval, and write the periodically acquired call stack of the at least one second thread into the preset file.

18. The terminal device according to claim 9 , wherein the computer program, when executed by a processor, causes the processor to:

write the time consumption for executing the task by the Runloop into the preset file, in the case that the Runloop does not enter a second execution state after the first execution state until the application is closed.

19. The terminal device according to claim 12 , wherein the computer program, when executed by a processor, causes the processor to:

delete the call stack recorded in the preset file, in a case that it is monitored that the execution state of the Runloop enters the second execution state after the first execution state.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 12, 2023
From: FENG, YADONG; BAI, KUNLUN
To: DOUYIN VISION CO.,LTD.
Reel/Frame 063920/0269 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 12, 2023
From: DOUYIN VISION CO., LTD.
To: BEIJING BYTEDANCE NETWORK TECHNOLOGY CO., LTD.
Reel/Frame 063920/0300 →
Priority Claims (1)
CN 202110112306.6 · Jan 27, 2021 · national
Continuity (1)
Related Publication 20240036969A1 · Feb 1, 2024
References Cited (15)
US 20090241095A1 · Jones · 2009 [cited by examiner]
US 20110320858A1 · Koktan · 2011 [cited by examiner]
CN 108446199A · 2018 [cited by applicant]
CN 109582536A · 2019 [cited by applicant]
CN 109840177A · 2019 [cited by applicant]
CN 109902011A · 2019 [cited by applicant]
CN 110990243A · 2020 [cited by applicant]
CN 111538638A · 2020 [cited by applicant]
CN 111625456A · 2020 [cited by applicant]
CN 112231132A · 2021 [cited by applicant]
CN 112764959A · 2021 [cited by applicant]
International Search Report (with English translation) and Written Opinion issued in PCT/CN2021/133878, dated Mar. 4, 2022, 13 pages provided. [cited by applicant]
Flying dog, “Stuck and stuck monitoring”, https://blog.csdn.net/xiaoming100001/article/details/107501757, Jul. 22, 2022, with English translation. [cited by applicant]
Wang, “(Non-official translation: How to Fix Applications Not Responding Issue)”, New Edited: Computer Assembly and Maintenance, 2nd Edition, CN, China Railway Press, Jan. 31, 2015, 6 pages. [cited by applicant]
Notification to Grant Patent Right for Invention for Chinese Patent Application No. 202110112306.6, mailed on Apr. 20, 2023, 6 pages. [cited by applicant]