Windows 32bit OS上で、一つの変数が使用できるメモリ容量を確認する方法はありますか?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 25 Okt. 2013
Beantwortet: MathWorks Support Team
am 25 Okt. 2013
Windows 32bit OS上で、一つの変数が使用できるメモリ容量を確認する方法について教えてください。
Akzeptierte Antwort
MathWorks Support Team
am 25 Okt. 2013
MATLAB コマンドウィンドウ上で FEATURE MEMSTATS と実行していただくと、マシンのメモリ情報を確認することができます。
feature memstats
Physical Memory (RAM):
In Use: 1184 MB (4a0df000)
Free: 2142 MB (85e4a000)
Total: 3327 MB (cff29000)
Page File (Swap space):
In Use: 1436 MB (59c92000)
Free: 3773 MB (ebd96000)
Total: 5210 MB (145a28000)
Virtual Memory (Address Space):
In Use: 1283 MB (50300000)
Free: 764 MB (2fce0000)
Total: 2047 MB (7ffe0000)
Largest Contiguous Free Blocks:
1. [at 53490000] 184 MB ( b870000)
2. [at 43b70000] 120 MB ( 7890000)
3. [at 615d0000] 74 MB ( 4a30000)
4. [at 68b40000] 40 MB ( 28c0000)
5. [at 5edcc000] 39 MB ( 27a4000)
6. [at 671e5000] 25 MB ( 193b000)
7. [at 3ace0000] 21 MB ( 1530000)
8. [at 3c73f000] 20 MB ( 1431000)
9. [at 71ce7000] 16 MB ( 1029000)
10. [at 66308000] 12 MB ( cf8000)
======= ==========
555 MB (22b51000)
各 Largest Contiguous Free Blocks は、一つの変数が使用できる最大メモリを示しています。メモリエラーが発生する要因として考えられるのは、変数が、Largest Contiguous Free Blocksのメモリ量を超えた場合が挙げられます。
例えば、
clear all
ppp = ones(24000000,1);
whos
Name Size Bytes Class Attributes
ppp 24000000x1 192000000 double
で、ppp の変数は約 180MB 容量を使用しています。(pppは、MATLAB のワークスペースに保存されています)
feature memstats
Physical Memory (RAM):
In Use: 1371 MB (55b76000)
Free: 1955 MB (7a3b3000)
Total: 3327 MB (cff29000)
Page File (Swap space):
In Use: 1620 MB (6547b000)
Free: 3589 MB (e05ad000)
Total: 5210 MB (145a28000)
Virtual Memory (Address Space):
In Use: 1466 MB (5ba1d000)
Free: 581 MB (245c3000)
Total: 2047 MB (7ffe0000)
Largest Contiguous Free Blocks:
1. [at 43b70000] 120 MB ( 7890000)
2. [at 615d0000] 74 MB ( 4a30000)
3. [at 68b40000] 40 MB ( 28c0000)
4. [at 5edcc000] 39 MB ( 27a4000)
5. [at 671e5000] 25 MB ( 193b000)
6. [at 3ace0000] 21 MB ( 1530000)
7. [at 3c73f000] 20 MB ( 1431000)
8. [at 71ce7000] 16 MB ( 1029000)
9. [at 66308000] 12 MB ( cf8000)
10. [at 7eb26000] 11 MB ( bca000)
======= ==========
382 MB (17eab000)
次に、扱える変数は、最大120 MBになります。この値を超える変数を扱った場合
qqq = ones(24000000,1);
?? メモリが足りません。オプションについては、HELP MEMORY と入力してください。
といったメモリエラーが表示されます。Simulink シミュレーション中のデータもMATLABのワークスペースに保存されますので、一つの変数が、Largest Contiguous Free Blocksの容量を超えた場合、メモリエラーが発生します。
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu パフォーマンスとメモリ finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!