Skip to content

Running out of memmory when using VideoCapture #209

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

Open
ThomasWatzl opened this issue Jan 3, 2015 · 5 comments
Open

Running out of memmory when using VideoCapture #209

ThomasWatzl opened this issue Jan 3, 2015 · 5 comments

Comments

@ThomasWatzl
Copy link

I am not entirely sure if this is an issue but I was running in some trubles using your module.
First of all thanks for a great opencv environment.

This code is just an example for what i am trying to do:

var cv = require('opencv');
var camera = new cv.VideoCapture(0);
camera.read(function reading(err, im){
            //do some image processing here.
    camera.read(reading);
});

For a while everything runs just fine but after a while I get the following error:

OpenCV Error: Insufficient memory (Failed to allocate 921604 bytes) in OutOfMemoryError, file /home/pi/opencv-2.4.10/modules/core/src/alloc.cpp, line 52
terminate called after throwing an instance of 'cv::Exception'
what(): /home/pi/opencv-2.4.10/modules/core/src/alloc.cpp:52: error: (-4) Failed to allocate 921604 bytes in function OutOfMemoryError

Is there a way to free memory? I thought the Carbage Collector should take care of that.

Thanks for your help.
Kind regards Thomas

@ThomasWatzl
Copy link
Author

Same is happening if I use the ReadSync method. Memory is filling up until it crashes.
Help would be much appreciated.

Kind regards Thomas

@Queuecumber
Copy link
Collaborator

Might be useful to add a dispose method to the Matrix class that frees the underlying cv::Mat immediately

@ThomasWatzl
Copy link
Author

yes that would be awesome

@redspike
Copy link

Has anyone managed to make any changes that help this?

@Mysteriosis
Copy link

Do you know which Object is overloaded ? What should we "flush" to keep the Memory ok ? (I have the same issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants