Reputation: 35
I read already several similar questions on the same topic but I still haven't managed to solve my issue. Since some time I am getting OUT OF MEMORY error;
this is very strange because I always worked on Matlab even with huger matrices and data (~ 3 millions rows) than now, and never experienced this issue before; instead, since yesterday, even if I try to make a simple matrix of zeros, I get this error. Btw, as I told you I saw the recommendations of Mathworks given here http://nl.mathworks.com/help/matlab/matlab_prog/resolving-out-of-memory-errors.html and those found on some answered questions here. So I : 1) increased the paging size setting Initial size 10000 MB, Maximum size 12150 MB 2) increased the Java Heap Memory to 2025 MB 3) Wrote again the code splitting the matrices into very small parts
I premise that I have a 8 GB RAM windows 64-bit machine. If I type the memory command, I get:
Does anyone has a clue on what do I have to do? I have kind of sensation it has to do with the computer rather than with Matlab itself, but I would like to hear the opinion of someone more experienced than me :)
Thank you in advance!!
Thank you Rollen Dsouza for you comment, you are right, here my incriminated code:
%% Investigation of negative peaks
%% main
clear all
close all
clc
cd('C:\Users\jemy\Downloads\CURRENT PROJECTS\SPIKE\code');
filename= 'Du-181014_D-ch27-Spikes_TimeStamps';
load(strcat('C:\Users\jemy\Desktop\SpikeS\', filename), 'Spikes');
load(strcat('C:\Users\jemy\Downloads\CURRENT PROJECTS\SPIKE\parameters\stend_', filename));
%% Splitting matrices
dim= size(Spikes, 1);
% First quarter of the file
sub_Spikes= double(Spikes(1:round(dim/16), :));
sub_stend= stend(1:round(dim/16), :);
clear Spikes;
clear Stend;
% Window where double minima will be searched
s= sub_stend(:, 14);
e= sub_stend(:, 5);
% Inizialization of results matrices
minima= zeros(size(sub_Spikes, 1), size(sub_Spikes, 2));
dev= zeros(size(sub_Spikes, 1));
Note: current size(sub_Spikes) is 145377x46.
Upvotes: 1
Views: 135
Reputation: 214
Are you sure you need dev= zeros(size(sub_Spikes, 1))
or did you forget ...,1)
? That's 2.1134e+10 (145377*145377) elements and my computer can't handle that either.
Don't have enough reputation to comment.
Upvotes: 2