Clear Filters
Clear Filters

java.lang.​OutOfMemor​yError: Java heap space using Matlab R2013a Java version 1.6.0_35-b10

2 views (last 30 days)
Hi,
  • I have download and installed Java 1.6.0_35-b10, so without while loop if i list add working , but when i have used while loop then i am getting java.lang.OutOfMemoryError: Java heap space.?
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);
}
}
I am getting error when i am run my mat-lab application.?
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 :please let me know where i have done mistaken ?because from input web cam video processing various coordinates values in list 1-by-8 matrix .?
  • Example :matrix =[1,2,3,4,5,6,7,8] ,[554,33,2,2,544,2332,2,2] etc..
  • Note 2: I have followed result link also ,but i cannot resolved my issue please let me know .
  • Link 1 : outofmememoryerror
  • Link 2: java.opts file
  3 Comments
Patrik Ek
Patrik Ek on 11 Mar 2014
Edited: Patrik Ek on 11 Mar 2014
You mean kind of "I want a two vector outputs, but get only one"? It kind of seems fair enough to me. Are you sure that your webcam returns the output you want from it. I seems to me that one 1-by-8 vector is returned for every reading.
SAMEER ahamed
SAMEER ahamed on 12 Mar 2014
Thanks for reply me . yes from input web cam video i have 1-by-8
On Mat-lab Part
matrix=[right_lip_x;right_lip_y;left_lip_xy;left_lip_yx;upper_lip_x;upper_lip_y;bottom_lip_x;bottom_lip_y]; %1-by 8 vector values
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 Part
public void list_method(List<Integer> points){
Sample sample = new Sample();
//Sample Class having private List<List<Integer>> matrix; Getter and Setter Method
sample.getMatrix().add(points);
}
My Result showing like :Sample [id=web cam 10:41:06 11/03/2014, matrix=[136, 41, 1, 41, 77, 8, 77, 72]] Sample [id=web cam 10:41:12 11/03/2014, matrix=[170, 49, 10, 49, 88, 10, 88, 84]] etc..
Actually I want to Expected result like Sample [id=web cam 10:41:12 11/03/2014, matrix=[136,41,1,41,77,8,77,72],[170, 49, 10, 49, 88, 10, 88, 84]] please let me know how i can get result?.
  • Note :If i have applied while loop list add i am getting error like java.lang.OutOfMemoryError: Java heap space.*

Sign in to comment.

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

No tags entered yet.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!