简体   繁体   English

Matlab,内存问题

[英]Matlab, memory issues

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; 这很奇怪,因为我一直在Matlab上工作,甚至比现在拥有更大的矩阵和数据(约300万行),而且以前从未遇到过这个问题。 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. 顺便说一句,正如我告诉你的,我看到了http://nl.mathworks.com/help/matlab/matlab_prog/resolving-out-of-memory-errors.html上给出的Mathworks建议,以及在此处已回答的一些问题上的建议。 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 所以我:1)增加了分页大小设置,初始大小为10000 MB,最大大小为12150 MB 2)将Java堆内存增加为2025 MB 3)再次编写了将矩阵拆分成非常小的部分的代码

I premise that I have a 8 GB RAM windows 64-bit machine. 我以拥有8 GB RAM Windows 64位计算机为前提。 If I type the memory command, I get: 如果键入memory命令,则会得到:

在此处输入图片说明

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 :) 我有一种与计算机而不是与Matlab本身有关的感觉,但是我想听听比我更有经验的人的意见:)

Thank you in advance!! 先感谢您!!

Thank you Rollen Dsouza for you comment, you are right, here my incriminated code: 谢谢Rollen Dsouza的评论,您是对的,这里是我的代码:

%% 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. 注意:当前大小(sub_Spikes)是145377x46。

Are you sure you need dev= zeros(size(sub_Spikes, 1)) or did you forget ...,1) ? 您确定需要dev= zeros(size(sub_Spikes, 1))还是忘了...,1) That's 2.1134e+10 (145377*145377) elements and my computer can't handle that either. 那是2.1134e + 10(145377 * 145377)元素,我的计算机也无法处理。 Don't have enough reputation to comment. 没有足够的声誉来发表评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM