help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

memory leak in regexprep ? (windows/3.7.2+/VS)


From: Christoph Ellenberger
Subject: memory leak in regexprep ? (windows/3.7.2+/VS)
Date: Tue, 26 Mar 2013 11:11:50 +0100 (CET)

I am experiencing some strange behavior and wanted to check if it is  a bug or me....
It happens when I try to read in and manipulating some ascii data files. It only happens with the VS version of octave. (tested with several gcc versions on windows and didn't showed up).
Ok here is some example code to reproduce:
First generating an ascii file:
s="0123456789";
for i=1:21, s=cstrcat(s,s);,endfor
save TestData.dat s
 
Then readin and manipulate:
fid = fopen("TestData.dat","r");
s = fscanf(fid,'%c');
fclose(fid);
s = regexprep(s,'0','2');
 
Clear all and repeat:
clear all
fid = fopen("TestData.dat","r");
s = fscanf(fid,'%c');
fclose(fid);
s = regexprep(s,'0','2');
 
Depending on datasize and how many replacement were performed it either fails on the new readin or regexprep with a: "error: out of memory or dimension too large for Octave's index type"
Any help is appreciated
Christoph
 
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]