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”。
看完了之後真的有很多感想。
今天來談談團隊。人月神話中提到軟體工程的團隊應該像外科手術團隊一樣,
有一個主力的外科醫師配上各有不同功能的醫護人員,其中包含針對手術的助手以及監控病人情況的麻醉師等。
IMGP1999  IMG_5841
在一個案子的初期規劃的時候,盡量想的面面俱到,預先想好分配。
但是事情總是沒有這麼簡單,世事本難如人所願。
若是在團隊成長的過程中,分配不均勻,後期打怪會有難度。
而少了一個人,就補一個人,補不到人就以一檔二。
這樣的打法到了後期loading反而集中在天天上場的長中繼上,
(註:天天上場的長中繼 :天天上場中繼,但都沒有後援,天天燒。)
當中繼掛了,先發就要撐到尾 Orz
 IMG_5837 IMG_5768
而在本來就資源使用得剛剛好的團隊,少了一個人都顯得捉襟見肘。
看著現在的問題,當Kevin對我說,下層都ok上層不知道怎麼了。
突然懷念System team這個名詞。
IMG_584724109_1289188673144_1333039465_31013041_4538613_n
現在說如果XXX在就不會ooo就太事後諸葛了。
都撐到最後了,”謀事在人,成事在天。”拼了~~~

後記:

1. 組合

真的要展望未來的話,我覺得外科團隊這個概念中,
值得借鏡的就是外科醫師跟麻醉師的組合。
一個實際操刀,一個掌握病人資訊。
一個人掌握Spec跟To-do,一個人追issue。
一個人對好急好急問題出TB,一個人繼續weekly build
一個探索未知領域,一個守成。
… …

2. 分配

少了一個人,就補一個人,補不到人就以一檔二。
這個戰術,最後其實有問題,
一條issue,二到三個人看,讓大家有個概念,可以彈性調動,
一個功能兩個人own,或是培養工具人,保留救火隊等
應該也稍可避免王牌燒壞的危險。


繼續努力扮演好自己的角色吧 !

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跟賽微要小心啦 ~

1. 語音辨識 + Search 


Nuance號稱是最大的語音辨識廠商,但是如果要玩語音搜尋,
只要跟Search扯上邊,誰打得贏Google !


之前跟Nuance或是賽微開會,都會談到這個願景 xD
但是說在的,如果世界上有很多個搜尋產品,我相信Google是裡面最好的 ~


2. 文法檔的格式


Google也有些新想法,不要訂死辨識格式,而是要針對不同功能用不同的form 。

We developed the "free form" model to improve dictation accuracy for the voice keyboard on the Nexus One, while the "web search" model is used when users want to search by voice.



詳情可以看RecognizerIntent


3. Voice Input

嘿嘿



以下影片介紹 Nexus One - Voice Input




應該相關文章:



From Search Beauty

好急好急,你 ~ 累了嗎?




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


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


--

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

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

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

共勉之 ~
Related Posts Plugin for WordPress, Blogger...

GoogleAd

Adventure Book 2.0 Headline Animator