2-5 記憶體管??

MATLAB 5 өMO޲zOG

zGMATLAB O޲zO
O
clearqO餤MܼƩΨ
packswưO骺ϥαpAϰOϥΪp̧ܳC
memoryܰOϥαp
quit} MATLABANҦܼƦΪOkٵ@~t

ҦpAYnܰOϥαpAiHJ memory OG

Example 1: 02-{XPO餧̨Τ/memory01.mmemoryMaximum possible array: 9471 MB (9.931e+09 bytes) * Memory available for all arrays: 9471 MB (9.931e+09 bytes) * Memory used by MATLAB: 1000 MB (1.049e+09 bytes) Physical Memory (RAM): 8030 MB (8.420e+09 bytes) * Limited by System Memory (physical + swap file) available.

bWzdҤAܥiΪO]Physical Memory^O 8169 MB]8 GB k^A MATLAB iΪ̤jOeqoWL 8 GBAhXӪAYO@~tΩҳ]wO]HϺЪŶӼO^C

Yb MATLAB {XɡAo͡uOut of memoryvĵiTAYܤwLŶieǷsܼơAiĨѨM׬G

  1. Hɨϥ clear OMAnܼơC
  2. pack OApOϥΪ{HC
  3. W[O骺jpAkpUG
    • Windows XPGiѡuxtΡiįB]wiBOBܧvUϧΤӶi]wC
    • Windows 7GiѡuxtΡitγ]wįB]wiBOBܧvUϧΤӶi]wC
  4. ξAXƫAC]ҦpApG@x}ȬOơAӥBȤ 0 ~ 255 A Ni uint8 xsAӤ doubleAԱаѨѩnf@uMATLAB {]pGJ gvAux}BzPBvux}ƫAvp`C^

pGWzkLkѨMAu֩ҥθƶqjpC@HAϥ MATLAB ɡAq`| FܼƩҦΪŶjpA|ҨӻApGnͤ@ 2000 2000 üƯx} yAڭ̥iH Ρuy = rand(2000);vA]C@ӤO 8 bytes ǸƫAA]ܼ y NY 8 2000 2000 = 32000000 bytes = 32 MBI]bA{XA@ϥܼ yANɶqUFuclear yvӲMܼơC

pGA{X@wnΨoǮeqWjܼơA̫@ۡ]]O²檺@ۡ^ANOAh@ǿӼW[O骺eqaIC


MATLAB{]pGig