



下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、Lab 6: 內(nèi)存泄漏目標(biāo)· 使用 Target Control 應(yīng)用工具來(lái)識(shí)別內(nèi)存泄漏估計(jì)時(shí)間: 30 minutes練習(xí)1 虛擬內(nèi)存泄漏Ø 增加內(nèi)存泄漏(LeakingMemory)工程到開發(fā)環(huán)境中1. 拷貝內(nèi)存泄漏( LeakingMemory )目錄到OS design目錄 D:WINCE500PBWorkspacesTrainingOSDesign.2. 選擇Project | Insert | Existing Subproject3. 選擇 TrainingOSDesign | LeakingMemory . 4. 選擇 LeakingMemory.pbpxm
2、l 并點(diǎn)擊 Open. PB將添加此工程到現(xiàn)有的OSDesign中5. 配置 LeakingMemory 工程,設(shè)置其為excluded from the image and always build and link as debug, 類似于 Lab 2-2 練習(xí)16. 右擊 LeakingMemory 工程,選擇 Build Current Project.Ø 調(diào)試程序7. 選擇 Target | Run Programs ,點(diǎn)擊LeakingMemory,再點(diǎn)擊RUN8. 觀察模擬器的輸出,下列消息將出現(xiàn)在模擬器的屏幕上: Note這個(gè)對(duì)話框用來(lái)阻止應(yīng)用程序繼續(xù)運(yùn)行(在沒有實(shí)
3、際的斷點(diǎn)情況下),從而可以使用內(nèi)存工具來(lái)觀測(cè)內(nèi)存情況. 這個(gè)對(duì)話框在內(nèi)存保留之前設(shè)置了斷點(diǎn),允許我們得到內(nèi)存使用的初始情況,從而可以和后續(xù)的內(nèi)存情況進(jìn)行對(duì)比。9. 選擇 Target | CE Target Control 。The Windows CE Command Prompt 窗口將顯示出來(lái)10. 在 Windows CE> 提示符中, 輸入mi full. 此時(shí)將顯示設(shè)備上運(yùn)行的所有進(jìn)程的內(nèi)存信息.11. 定為到 LeakingMemory.exe 進(jìn)程的內(nèi)存信息處.12. 利用下列信息研究虛擬內(nèi)存的內(nèi)容: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. 拷貝此時(shí)LeakingMemory 進(jìn)程的內(nèi)存信息到一個(gè)臨時(shí)的文本文件中,以便于和稍后經(jīng)過
9、變化的內(nèi)存信息進(jìn)行比較.14. 在模擬器窗口中,點(diǎn)擊 OK . 此時(shí)應(yīng)用程序?qū)⑦\(yùn)行并執(zhí)行相關(guān)的動(dòng)作.15. 下圖是執(zhí)行之后的窗口16. 在 Windows CE> 提示符中, 再次輸入 mi full. 此時(shí)將顯示設(shè)備上所有進(jìn)程當(dāng)前的內(nèi)存信息.17. 將此時(shí) 進(jìn)程的內(nèi)存信息與前面的進(jìn)行比較.18. 點(diǎn)擊 OK 使得應(yīng)用程序退出.分析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. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 急性附睪炎患者的護(hù)理
- 開發(fā)項(xiàng)目股權(quán)質(zhì)押合同
- 建筑防水責(zé)任合同
- 商標(biāo)合作開發(fā)合同(2篇)
- 工作地點(diǎn)變更合同
- 2025年統(tǒng)編版小學(xué)道德與法治三年級(jí)下冊(cè)《生活離不開規(guī)則》說課課件
- 臨時(shí)搬家工人合同
- 伊利公司供應(yīng)鏈管理
- 如何把書做成課件
- 中國(guó)教育夢(mèng)培訓(xùn)
- 2025-2030中國(guó)集裝箱化和模塊化數(shù)據(jù)中心行業(yè)市場(chǎng)發(fā)展趨勢(shì)與前景展望戰(zhàn)略分析研究報(bào)告
- 2025-2030中國(guó)防腐新材料行業(yè)市場(chǎng)深度調(diào)研及發(fā)展策略與投資前景預(yù)測(cè)研究報(bào)告
- 2025年護(hù)工考試試題及答案
- 2025屆成都市2022級(jí)高中畢業(yè)班第二次診斷性檢測(cè)語(yǔ)文試題及答案
- 2025屆北京市第四中學(xué)順義分校高三零模英語(yǔ)試題(原卷版+解析版)
- 全國(guó)第9個(gè)近視防控月活動(dòng)總結(jié)
- 智能傳感器研發(fā)-第1篇-深度研究
- 2025至2030年中國(guó)快速換模系統(tǒng)數(shù)據(jù)監(jiān)測(cè)研究報(bào)告
- 2025年舉辦科普月的活動(dòng)總結(jié)(3篇)
- 2025年高三語(yǔ)文上學(xué)期期末考試作文題目解析及范文:關(guān)于鴻溝的思考
- 2025年春新人教版化學(xué)九年級(jí)下冊(cè)課件 第十一單元 化學(xué)與社會(huì) 課題1 化學(xué)與人體健康
評(píng)論
0/150
提交評(píng)論