-
-
Notifications
You must be signed in to change notification settings - Fork 25
Memory leak #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Confirmed, Mat_Set will cause a memory leak even though manually dispose Mat, but every thing looks ok, not sure why... Lines 708 to 713 in b71f6d1
opencv_dart/lib/src/core/mat.dart Lines 517 to 519 in b71f6d1
|
@cike111 v1.0.10 and 2.0.0-dev.12 have been published, please update and try if it has been solved, if not please open this issue again. |
@rainyl Your approach seems to have some effect, but it hasn't completely solved the problem. |
@cike111 emmmmm..., alright, I suggest you to dispose it manually if you have to create mats in a loop, due to the limitation of dart GC (#64 (comment)), the attached native resources may not be freed timely, in the above example, change it to test(){
CV.Mat grayMat = CV.Mat.zeros(
1000, 1000, CV.MatType.CV_8UC1);
int maxY = grayMat.rows - 1;
int maxX = grayMat.cols;
for (int y = maxY; y >= 0; y--) {
for (int x = 0; x < maxX; x++) {
grayMat.set<int>(0, 0, 30);
}
}
// add this line
grayMat.dispose();
} If the problem still exists, then I have no more ideas too, and I have no apple devices so can't debug it, on my windows PC every thing is ok. |
Describe the bug
In iOS, if you call grayMat.set(y, x, grayLevel) every 2 seconds, it will cause the memory to continuously increase
To Reproduce

pubspec.yaml code:
mian.dart
The text was updated successfully, but these errors were encountered: