Application failed to launch in time... but it's only taking 2 seconds? - iphone

Our application is crashing, and the crash log says;
Application Specific Information:
com.xxxx.xxxxx failed to launch in time
elapsed total CPU time (seconds): 2.120 (user 1.200, system 0.920), 11% CPU
elapsed application CPU time (seconds): 0.800, 4% CPU
...
Unknown thread crashed with unknown flavor: 5, state_count: 1
I'm sure it can't be crashing out because it's taking a whopping 2 seconds to launch! Does anyone have any other ideas why we might be getting this message?
Thanks in advance,

The two seconds are CPU time, the elapsed real time was probably longer (with 11% CPU load, it would be more like 20 seconds).

Related

Reduce CPU usage by using sleep

I'm taking snapshots from AR view 30 times per sec and sending it on another vc to process, the cpu usage goes eventually until 280% and the device gets too hot and the performance decrease and then I have frame drops.
I'm thinking of using Thread.sleep to make the thread sleep for 1 sec in every minutes, my question is, do you think it's a good approach? does it have any effects at all to reduce CPU usage or cool down the phone a bit? Or there is another better way?
If the thread sleep for 1 sec in 1 min, doesn't matter much for me.
Thank you so much

IOS How to debug 9 seconds cpu time over 36 seconds (25% cpu average), exceeding limit of 15% cpu over 60 seconds

The high cpu usage rate threshold looks to have been lowered on iOS 15. Possibly from 80% in 60sec to 15% in 60sec? I have noticed that my app does NOT run correctly on IOS 15 and the background operations seem to stop like location, and some timers... I have a lot of #Published property's being updated while in the background, would this affect the background operations terminating after ~40 seconds in the background? If So how would I go about Updating my UI and keeping the constant updates to the published property.
I am getting the message:
Event: cpu usage
Action taken: none
CPU: 9 seconds cpu time over 36 seconds (25% cpu average), exceeding limit of 15% cpu over 60 seconds
CPU limit: 9s
Limit duration: 60s
CPU used: 9s
CPU duration: 36s
Duration: 35.85s
Duration Sampled: 25.92s
Steps: 5

What fraction of the CPU time is wasted ? (Modern Operating Systems, 4th ed)

it's my first post here.
I'm currently learning Modern Operating Systems and I'm stuck at this question : A computer system has enough room to hold five programs in its main memory. These programs are idle waiting for I/O half of the time. What fraction of the CPU time is wasted?
The answer is 1/32, but why ?
The answer is 1/32, but why ?
The sentence "These programs are idle waiting for I/O half of the time" is ambiguous. Let's look at a few different ways of interpreting this sentence and see if they match the expected answer:
a) "Each of the 5 programs spends 50% of the total time waiting for IO". In this case, while one program is waiting for IO the CPU could be being used by other programs; and all programs combined could use 100% of CPU time with no time wasted. In fact, you'd be able to use 100% of CPU time with only 2 programs (the 1st program uses the CPU while the 2nd program waits for IO, then the 2nd program uses the CPU while the 1st task waits for IO, then ...). This can't be the intended meaning of "These programs are idle waiting for I/O half of the time" because the answer (possibly zero CPU time wasted) doesn't match the expected answer.
b) "All of the programs are idle waiting for I/O at the same time, for half the time". This can't be the intended meaning of the question because the answer would obviously be "50% of CPU time is wasted" and doesn't match the expected answer.
c) "Each program spends half of the time available to it waiting for IO". In this case, the first program has 100% of CPU time available to it but spends 50% of the time using the CPU and waits for IO for the other 50% of the time, leaving 50% of CPU time available for the next program; then the 2nd program uses 50% of the remaining CPU time (25% of total time) using the CPU and 50% of the remaining CPU time (25% of total time) waiting for IO, leaving 25% of CPU time available for the next program; then the third program uses 50% of the remaining CPU time (12.5% of total time) using the CPU and 50% of the remaining CPU time (12.5% of total time) waiting for IO, leaving 12.5% of CPU time available to the next programs, then...
In this case, the remaining time is halved by each program, so you get a "negative power of 2" sequence (1/2, 1/4, 1/8, 1/16, 1/32) that arrives at an answer that matches the expected answer.
Because we get the right answer for this interpretation, we can assume that this is what "These programs are idle waiting for I/O half of the time" was supposed to mean.

What does the time on executing perl tests specify

I had a large number of Selenium based perl Testscripts. After the complete Testing it prints a log as follows. What does this specify? How the time below is calculated and on what basis
Files=1, Tests=17, 209 wallclock secs ( 0.13 usr + 0.01 sys = 0.14 CPU)
209 wallclock secs ( 0.13 usr + 0.01 sys = 0.14 CPU)
It took 209 seconds to run. These seconds are time elapsed as per the clock on the wall (or on your wrist).
Most of this time has been spent waiting on something. Waiting? Well, the CPU spent a lot of time waiting, so while time elapsed the CPU wasn't working on the program being timed. We know this because the actual CPU time is reported to be only 0.14 seconds, so that means almost all of the 209 seconds just waiting.
There's a further distinction to be made between time spent in usermode and time spent in syscalls. Briefly, the former refers to time the CPU spent on your program proper while the latter refers to time the CPU spent dealing with syscalls, that is calls made into the operating system on behalf of your program.
Addendum for multi-cores: As #ArtM pointed out, or rather made me discover, the times given for usr and sys are cumulative for all cores the program has run on, which means that there may be cases when the total CPU time or even any one of usr and sys may be higher than the wallclock time, which may seem odd but makes sense when you think about the parallelism on multiple cores.
If you want to learn more about this usr/sys or user-mode versus kernel-mode issue, take a look at this more comprehensive answer.

Xcode Instruments CPU time

if i run an application with the performance test, the "cpu monitor" show me some informations like process ID/Name or CPU Time. But in which unit of time does it measure ?
An example: if i get 05.04 , what does mean for me
Best Regards
Plagiarized from http://en.wikipedia.org/wiki/CPU_time -
CPU time (or CPU usage, process time) is the amount of time for which a central processing unit (CPU) was used for processing instructions of a computer program, as opposed to, for example, waiting for input/output (I/O) operations.
The CPU time is often measured in clock ticks or seconds. CPU time is also mentioned as percentage of the CPU's capacity at any given time on multi-tasking environment. That helps in figuring out how a CPU’s computational power is being shared among multiple computer programs.