10/07/2009

Progress, progress, and... progress

..moreover, progress.
It was inevitable to learn how to use Instruments due to my buggy-awesomeness-code-of-doom. I found a huge bug where a memory wasn't being freed by Apple's API because I was trying to paste a blank string to a UITextView. This didn't show up in the Leaks Instruments, but it was living forever which could be observed through Object Allocations. It was about 100KB per minute, which adds up over time and crashes the app.
And finally, more progress is yet to come.

進行、 進展、前進するのみ。Instrumentsを使ったデバッグの作業になかなか慣れてきた今日この頃。繊細におおらかに書かれたバグだらけのコードをデバッグするには不可欠。今日はAppleのAPIで生成されたオブジェクトがフリーされてない問題を解決した。いや、一瞬たりとも「アップルのバグか?」とか全然これっぽっちも思ってなかったけど、やっぱり問題は自分でUITextViewに空のNSStringを入れようとしてたみたいでそれがMalloc 160 bytesを蓄積してた。結果、毎分100KBぐらいのリークが発生しててこの数週間悩まされてたんだぜぇ〜。初代iPhoneだと15分ぐらいでクラッシュするという始末。明日はまた違うリークを解決するぞと。
精が出るぜぇ〜。出るんだぜぇ〜。とぜぇぜぇ言いながらやってます。

No comments:

Post a Comment