Closed GoogleCodeExporter closed 8 years ago
Sure, we should be able to call release() on them as well.
Original comment by samuel.a...@gmail.com
on 28 Aug 2013 at 9:55
First of all: Thank you for incredible fast reply :). And the second thing:
So maybe it's strange question, but how can I invoke release() method on them?
This code:
CvMatArray array=new CvMatArray();
array.release();
CvScalar scalar=new CvScalar();
scalar.release();
doesn't work...
Original comment by mirkro...@gmail.com
on 28 Aug 2013 at 10:26
Have you also tried to call System.gc() after release() to make sure that the
garbage collector actually runs to release memory taken by Java?
Original comment by samuel.a...@gmail.com
on 28 Aug 2013 at 10:29
No I haven't and after some tests I see that it's good idea :).
In this case:
for(int i=0;i<100000000;i++){
CvMatArray array=new CvMatArray();
CvScalar scalar=new CvScalar();
System.gc();
}
I don't have memory leaks. I noticed also that if I write something like that:
for(int i=0;i<100000000;i++){
IplImage array=IplImage.create(zmieniane.cvSize(), 8, 1);
array.release();
System.gc();
}
I HAVE TO also use System.gc() even although I used .release().
Anyway, problem is solved. Thanks for help.
Original comment by mirkro...@gmail.com
on 28 Aug 2013 at 11:04
Good! Please ask your questions on the mailing list next time if possible,
thanks!
Original comment by samuel.a...@gmail.com
on 31 Aug 2013 at 7:06
Original issue reported on code.google.com by
mirkro...@gmail.com
on 28 Aug 2013 at 9:45