Skip to Content
Android Developer Tools深入精要
book

Android Developer Tools深入精要

by Mike Wolfson
July 2014
Intermediate to advanced
248 pages
5h 19m
Chinese
GoTop Information, Inc.
Content preview from Android Developer Tools深入精要
記憶體分析工具(
Memory Analyzer Tool, MAT
|
157
Eclipse
中執行
MAT
若你是使用
Eclipse
,則當按下
DDMS
裡的「
Dump HPROF file
」(傾印
HPROF
檔案)
按鈕(
),則會自動地轉換
HPROF
檔案並且開啟
MAT
工具(若已安裝);若你想
設定此為預設行為,點選
Window
Preferences
Android
DDMS
若你想查看歷史
heap
資料,你可以保存
HPROF
檔案(這可以在自動測試時執行,或
是手動操作)。
[Page-161]
利用
MAT
來分析
HPROF
檔案
由於
MAT
工具有豐富的功能以及多個方法可用於找出記憶體問題,所以使用起來有點
複雜;我將會介紹三個最常使用的選項,若你想了解其他選項,則官方網站
http://www.eclipse.org/mat/
)會是很好的資源。
當你執行
MAT
精靈時,第一個出現的畫面如圖
10-6
,它提供三個選項檢視你的資料:
記憶體洩漏疑點報告(
Leak Suspects Report
自動分析你的檔案判斷記憶體洩漏;這也會回報那些仍維持存活的物件,以及阻
擋這些物件被垃圾回收的原因。
元件報告(
Component Report
讓你可以分析特定的檔案,以及尋找重複的字串、未使用的物件集合、
weak
reference
與其他記憶體問題。
重啟先前的報告(
Reopen previously run reports
利用此工具檢視先前執行的報告。
158
|
第十章:監控系統資源 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Android 高效能多執行緒

Android 高效能多執行緒

Anders Goransson
深入淺出 jQuery

深入淺出 jQuery

Ryan Benedetti, Ronan Cranley
HTML5 錦囊妙計

HTML5 錦囊妙計

Christopher Schmitt, Kyle Simpson

Publisher Resources

ISBN: 9789863470861