實驗9內存泄漏_第1頁
實驗9內存泄漏_第2頁
實驗9內存泄漏_第3頁
實驗9內存泄漏_第4頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、Lab 6: 內存泄漏目標· 使用 Target Control 應用工具來識別內存泄漏估計時間: 30 minutes練習1 虛擬內存泄漏Ø 增加內存泄漏(LeakingMemory)工程到開發(fā)環(huán)境中1. 拷貝內存泄漏( LeakingMemory )目錄到OS design目錄 D:WINCE500PBWorkspacesTrainingOSDesign.2. 選擇Project | Insert | Existing Subproject3. 選擇 TrainingOSDesign | LeakingMemory . 4. 選擇 LeakingMemory.pbpxm

2、l 并點擊 Open. PB將添加此工程到現(xiàn)有的OSDesign中5. 配置 LeakingMemory 工程,設置其為excluded from the image and always build and link as debug, 類似于 Lab 2-2 練習16. 右擊 LeakingMemory 工程,選擇 Build Current Project.Ø 調試程序7. 選擇 Target | Run Programs ,點擊LeakingMemory,再點擊RUN8. 觀察模擬器的輸出,下列消息將出現(xiàn)在模擬器的屏幕上: Note這個對話框用來阻止應用程序繼續(xù)運行(在沒有實

3、際的斷點情況下),從而可以使用內存工具來觀測內存情況. 這個對話框在內存保留之前設置了斷點,允許我們得到內存使用的初始情況,從而可以和后續(xù)的內存情況進行對比。9. 選擇 Target | CE Target Control 。The Windows CE Command Prompt 窗口將顯示出來10. 在 Windows CE> 提示符中, 輸入mi full. 此時將顯示設備上運行的所有進程的內存信息.11. 定為到 LeakingMemory.exe 進程的內存信息處.12. 利用下列信息研究虛擬內存的內容:CharacterDefinition<blank>A bl

4、ank space indicates a virtual page that is not currently allocated. Does not require a physical page.-Reserved but not in use. Indicates a virtual page that is currently allocated but not mapped to any physical memory. Does not require a physical page.CCode pages in ROM. Does not require a physical

5、page.cCode pages in RAM. Requires a physical page.SIndicates a virtual page that holds a stack. Requires a physical page.PPeripheral memory (pages used to map target device memory by using VirtualAlloc). Indicates a virtual page that is used to map a range of hardware addresses. Does not require a p

6、hysical page. Peripheral memory may include frame buffer memory.WIndicates a virtual page that holds read-write data. Requires a physical page. Read-write pages include global variables as well as dynamically allocated memory.OIndicates a virtual page that is used by the object store. Requires a phy

7、sical page. Should only appear in the Filesys process.?Contents unknown.rRead-only data pages in RAM. Requires a physical page. Read-only data primarily comes from data items that are declared as a const type in the source code.RRead-only data pages in ROM. Does not require a physical page. Read-onl

8、y data primarily comes from data items that are declared as a const type in the source code. Note: For CPUs such as ARM and SHx that do not distinguish between read-only and executable code pages in hardware, use R(r) to represent both data and code. 13. 拷貝此時LeakingMemory 進程的內存信息到一個臨時的文本文件中,以便于和稍后經過

9、變化的內存信息進行比較.14. 在模擬器窗口中,點擊 OK . 此時應用程序將運行并執(zhí)行相關的動作.15. 下圖是執(zhí)行之后的窗口16. 在 Windows CE> 提示符中, 再次輸入 mi full. 此時將顯示設備上所有進程當前的內存信息.17. 將此時 進程的內存信息與前面的進行比較.18. 點擊 OK 使得應用程序退出.分析BeforeAfterMemory usage for Process 80fce840: 'LeakingMemory.exe' pid 8Slot base 12000000 Section ptr 83d2e000 12000000(1)

10、: -r- 12010000(0): -cW 12020000(0): -SSS 12030000(0): W- 12050000(0): - 13ed0000(0): - 13ff0000(0): -ccPage summary: code=3(3) data r/o=0 r/w=3 stack=3 reserved=377Memory usage for Process 80fce840: 'LeakingMemory.exe' pid 8Slot base 12000000 Section ptr 83d2e000 12000000(1): -r- 12010000(0): -cW 12020000(0): -SSS 12030000(0): W- 12050000(0): - 12060000(0): WWWWWWWWWWWWWWWW 12070000(0): WWWWWWWWWWWWWWWW 13ed0000(0): - 13ff0000(0): -ccPage summary: code=3(3) data r/o=0 r/w=35 stack=3 reserved=377通過CE Target Control 工具的輸出顯示有128

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論