- The * operator is algebraic matrix multiplication. For multiplying an n x m matrix by an m x p matrix, it produces an n x p matrix. In particular if you accidentally use * to multiply a column vector by a row vector then the result is going to be length(column) by length(row)
- The / operator is matrix divison, A/B being similar to A*pinv(B) . This produces an output with as many columns as there were rows in the denominator. That might not trigger an immediate error, but it gives you a row vector where you probably expected a column vector, and if you happened to * that... see first point about sizes for * operator.
- If you pass a vector to rand() or zeros() or ones() then the produce arrays with as many dimensions as the length of the array. For example, people sometimes do zeros(1:50) expecting to produce a vector of length 50 that is initialized to 0, but this instead creates a 50 dimensional array that is 1 x 2 x 3 x 4 x 5 x 6 .... x 50 . Which you totally do not have enough memory for.
- Since R2016b, most of the binary operations act as if there was a bxsfun() coded. If you happen to have coded a row vector in a binary operation with a column vector then you get a result which is length() of the row by length() of the column instead of an error like you would have gotten previously. For example, (10:10:90).' + (0:8) now gives a 9 x 9 array instead of an error. It is not uncommon for people to forget which vectors are which row vectors and which are column vectors and try to do a binary operation on them thinking they are going to get element-by-element arithmetic in a vector.
how to resolve out of memory error in matlab R2017a
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have tried all the solution available on internet for solving out of memory issue but i am still getting out of memory error.
Links i followed are: https://www.mathworks.com/help/matlab/matlab_prog/resolving-out-of-memory-errors.html and https://www.mathworks.com/matlabcentral/answers/224820-how-can-i-fix-an-out-of-memory-error and https://www.mathworks.com/matlabcentral/answers/153250-out-of-memory-help-needed
this is the result of "memory" command in matlab
memory
Maximum possible array: 21444 MB (2.249e+10 bytes) *
Memory available for all arrays: 21444 MB (2.249e+10 bytes) *
Memory used by MATLAB: 1371 MB (1.437e+09 bytes)
Physical Memory (RAM): 4019 MB (4.215e+09 bytes)
* Limited by System Memory (physical + swap file) available.
- I have increaded java heap size, unchecked the MATLAB array size limit.
- I have also increased the windows virtual memory paging size to 21650 MB.
My issue is not resolved :( . Can anyone help me? My os is 64 bit and matlab is also 64 bit.
0 commentaires
Réponses (1)
Walter Roberson
le 29 Jan 2018
There is nothing you can do to repair an "out of memory" situation if your program needs to allocate more memory than you have on your system.
It sounds as if you are not expecting that your program uses that much memory. You need to figure out which line of code is triggering the error, and you need to examine the sizes of the expressions and work out the size of the output that the operators would produce.
Common mistakes include:
2 commentaires
Walter Roberson
le 30 Jan 2018
alexnet needs a lot of memory, including a fair amount of memory on your NVIDIA GPU.
Voir également
Catégories
En savoir plus sur Performance and Memory dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!