[問題] out of memory已回收

看板MATLAB作者 (六九怪客)時間14年前 (2011/08/31 22:24), 編輯推噓1(105)
留言6則, 3人參與, 最新討論串5/5 (看更多)
我跑一個程式 a=rand(75,25000,'double'); clustergram(a,'pdist','euclidean','linkage','average','Dendrogram',{'colorthreshold','default'}) 它會顯示out of memory 我打feature('memstats'); Physical Memory (RAM): In Use: 837 MB (34549000) Free: 1721 MB (6b922000) Total: 2558 MB (9fe6b000) Page File (Swap space): In Use: 874 MB (36aa7000) Free: 71575 MB (11797b3000) Total: 72450 MB (11b025a000) Virtual Memory (Address Space): In Use: 676 MB (2a442000) Free: 2395 MB (95b9e000) Total: 3071 MB (bffe0000) Largest Contiguous Free Blocks: 1. [at 7ffe1000] 1022 MB (3fea7000) 2. [at 43ec3000] 357 MB (1654d000) 3. [at 28d50000] 343 MB (15770000) 4. [at 621f9000] 94 MB ( 5e07000) 5. [at 40221000] 59 MB ( 3b6f000) 6. [at 5d36b000] 50 MB ( 3245000) 7. [at 6d346000] 43 MB ( 2b5a000) 8. [at 5a447000] 35 MB ( 23d9000) 9. [at 60605000] 27 MB ( 1beb000) 10. [at 6fff6000] 25 MB ( 19ba000) ======= ========== 2059 MB (80bf7000) 資料的型態一定要是double 很多方法我都試過了.但還是無效 我的電腦是32位元XP.32位元matlab.2GB的RAM 盡量不更換硬體的情況下.有何辦法才不會造成out of memory? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 125.230.121.198

09/01 01:15, , 1F
一邊算一邊clear沒有使用到的變數
09/01 01:15, 1F

09/01 09:49, , 2F
可是原PO是算距離矩陣, 是一次算出來...應該無法clear
09/01 09:49, 2F

09/01 09:50, , 3F
說錯, 不是矩陣, 只是許多兩點間的距離
09/01 09:50, 3F

09/03 02:09, , 4F
重點應該是 matlab會 show 在 程式的哪一行 out of memory
09/03 02:09, 4F

09/03 02:10, , 5F
在最後執行的那一行設 breakpoint, 跑 feature('memstats')
09/03 02:10, 5F

09/03 02:10, , 6F
你才會知道為什麼會 out of memory
09/03 02:10, 6F
文章代碼(AID): #1ENaGlXt (MATLAB)
文章代碼(AID): #1ENaGlXt (MATLAB)