I am new for mat-lab and java , so i would like to list add in while loop .below i have mentioned ?
OS: Windows 7 ,64 bit .
- On Mat-lab Part Side
list=java.util.ArrayList();
for k=1:length(matrix)
list.add(int32(matrix(k)));
end
import edu.lipreading.*;
training = MainMethod;
training.list_method(list);
on Java Class Part Side
public void list_method(List<Integer> points){ while(true){ Sample sample = new Sample(); sample.getMatrix().add(points);} }
When I am run my mat-lab i got Error :
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2734)
at java.util.Vector.ensureCapacityHelper(Vector.java:226)
at java.util.Vector.add(Vector.java:728)
at edu.lipreading.MainMethod.onRecord(MainMethod.java:40)
at edu.lipreading.MainMethod.list_method(MainMethod.java:26)
Note : I have referred link also : java.lang.OutOfMemoryError: Java heap space on startup