Labels

Adventure Book 2.0 Headline Animator

推薦內容

Wednesday, March 17, 2010

how to trace memory leak in Android ?

this post is really a question, doesn't contain the answer Orz


this big question may consist of several items


what is memory leak ? 


how  to monitor Android system memory and performance ?



linux command :


ps -x
top
cat /proc/meminfo


not know exactly : 


dumpsys meminfo proc-id
procrank
time command-line
vmstat


and DDMS (Android SDK tool) !!


Could automatic track memory leak on Android ?


DDMS could help !


but need to do some settings ( group discuss Finding Memory leak in native code )


0. Build libc_debug.so 


1. replace system/lib/libc.so with /system/lib/libc_debug.so 


2. set environment variables 



 $PATH with ~/open_src/prebuilt/linux-x86/toolchain/arm-eabi-XXX/bin
 $ANDROID_PRODUCT_OUT with ~/open_src/out/target/product/



'PATH' is used for getting "arm-eabi-addr2line" and
ANDROID_PRODUCT_OUT for getting the path to /symbol folder. 




3. restart the framework.  


adb shell stop && adb shell start 


4. Add "native=true" to  ~/.android/ddms.cfg


5. start the stand-alone version of DDMS.  -> "Native Heap" 


but just know that there  was an malloc @@ !!


how to avoid memory leak in application ?


from Avoid memory leaks on Android suggestion:




  • Do not keep long-lived references to a context-activity (a reference to an activity should have the same life cycle as the activity itself)
  • Try using the context-application instead of a context-activity
  • Avoid non-static inner classes in an activity if you don’t control their life cycle, use a static inner class and make a weak reference to the activity inside



to be continued ...



What is memory leak ?

What is memory leak ?

wiki said:


memory leak or leakage in computer science is a particular type of memory consumption by a computer program where the program is unable to release memory it has acquired.


more detail in :


http://en.wikipedia.org/wiki/Memory_leak


an easy understand example about memory leak, please refer to this link:


女工程師的美加生活手札- Memory Leak 


other related webpage :



Handling memory leaks in Java programs

Memory Leak Detection in C++

Wednesday, March 10, 2010

缺一不可的外科手術團隊

“邊作案子邊看人月神話,有種拳拳到肉,被打的鼻青臉腫的fu”。
看完了之後真的有很多感想。
今天來談談團隊。人月神話中提到軟體工程的團隊應該像外科手術團隊一樣,
有一個主力的外科醫師配上各有不同功能的醫護人員,其中包含針對手術的助手以及監控病人情況的麻醉師等。

Saturday, March 6, 2010

HTML5 rocks !



Google說 The browser is the computer

這個願景,需要HTML5 !

先提一下,什麼是HTML5 ?



且Google準備了些HTML5應用:










另外提供一些一看就是相關網站的相關網站 

http://html5.org/

心得:
1. 資訊日新月異,沒事多上網,多上網沒事
2. 被Issue搞得 一看到Canvas先想到Street View @@

Android與語音辨識 Speech Input API for Android

從Android官方Blog推出一篇新文章 Speech Input API for Android
Nuance跟賽微要小心啦 ~

好急好急,你 ~ 累了嗎?




我感覺寫什麼A.S.A.P 太不親切了~
所以我都寫好急好急。


有人問我,好急好急是什麼程度,
阿 ~ 阿就 好急好急阿 @@


--

不過原本只是跟Jimmy老師搞笑的對話,
突然有些感想,想要對SPM說 :

一天到晚好急好急,真的不累嗎 @@
我感覺到你累我也累,

"有妥善的計畫,才會有順利的專案。"

共勉之 ~

Welcome to Taiwan ! 推薦台灣住宿