Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
304 views
in Technique[技术] by (71.8m points)

ios - How to analyze stack trace info of a thread?

I'm trying to monitor performance of my app;

When cpu usage overloads, I dump the stack trace of the suspicious thread and main thread as string by two libs: https://github.com/bestswifter/BSBacktraceLogger https://github.com/plausiblelabs/plcrashreporter

Following are the stack trace of one thread that I record, but it cannot help me analyze and locate where the performance issue is.

Am I doing wrong or how can I analyze the stack trace of a thread?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Ohkay ! I somewhat got your problem. What is your app about,? I mean is it a Game or something.? With this very info, I'll give you few workarounds,

  • I would suggest you to thoroughly study the code and de-initialize all the resources which are not being used.
  • Check for how many static properties and global variables/properties you’re using and ask yourself are they even required ?
  • Also I would again suggest you to monitor your app with Instruments look very precisely when the memory bar is going high and when low [e.g. by opening what ViewController it eats up a lot, by closing what ViewController the memory bar goes down, is your app dependent on GPS coz in big applications like uber they do not update locations on didUpdateLocations rather they use other methods, like singletons / Timer / heartbeats etc,]
  • Plus if you wanna avoid all this manual work, go for NewRelic

A small tutorial for that : link

Post again for more, Would be happy to help. =)


Here are some links : by using and combining them with firebase you'll be able to see events and logs as well, here's 1st -> watchdog

here's the 2nd 1 -> Prints the filename, function name, line number and textual..etc..

Now combine any of that with firebase and it'll send the logs to you directly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...