I try to manipulate big strings in rascal and get constantly the following error:
java.lang.OutOfMemoryError: Java heap space(internal error).
I changed the following parameters in the eclipse.ini file:
-XX:MaxPermSize=1024m
-Xms256m
-Xmx1024m
But that changes nothing.
The code looks like this:
public str removeBB(str file){
while(contains(file, "aB")){
index1 = findFirst(file, "aB");
index2 = (findFirst(file, "Ba") + 2);
subString1 = substring(file, 0, index1);
subString2 = substring(file, index2);
file = subString1 + subString2;
}
return file;
}
How can i prevent this error? Are there ways to write that code so that it is more memory efficient?