Skip to content
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

kinect.getRawDepth() memory leak? #18

Closed
johnbcarpenter opened this issue Oct 23, 2011 · 4 comments
Closed

kinect.getRawDepth() memory leak? #18

johnbcarpenter opened this issue Oct 23, 2011 · 4 comments

Comments

@johnbcarpenter
Copy link

i've been trying to figure out why my processing app using openkinect was crashing out consistently at 4hours 40min, and now my best guess is that there's a memory leak in kinect.getRawDepth() . not sure if this happens on everyone's computer, but i'm working on a brand new mac mini (Model: Macmini5,2, Intel Core i5, 2.5 GHz, 4 GB) with lion and the latest installation of java.

in any case, when i run the openkinect point cloud demo, i'm also getting the crash at about the same time interval (4h45m / 5 hrs), and i'm suspecting getRawDepth because i'm still seeing a memory leak when i comment out everything in the pointcloud demo except kinect.getRawDepth() . in the 10 minutes it took me to log in and make a couple comments here my real memory useage has gone from 60.2MB to 142.1MB. figure this may be an issue with libfreenect?

@siusoon
Copy link

siusoon commented Feb 17, 2012

I got a similar problem here too. Mine is with 10.5.8 MacOS, java 1.5
The error as:
java(155,0x830400) malloc: *** mmap(size=16777216) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug

Duno if this will help by setting depth=null and do the System.gc(); Will try and test again...
The other thing I found is sometimes the screen will freeze, no error message. It seems the stream has been disconnected. Wondering if there is anyway to wake up the stream again or restart/reset it...

@johnbcarpenter
Copy link
Author

sorry you're having the same issue siusoon. i just updated the mac minis to os x 10.7.3 and java 1.6.0 and i'm still seeing crashes, but it significantly increased the length of time the app would run before crashing from ~4.5hrs to ~8hrs. i still think there's something going on with getRawDepth... like the depth image doesn't have a chance to completely update before the next time it's used and maybe this is complicated by memory intensive tasks/image calls? i'm also seeing my application becoming unresponsive every once in a while (if it doesn't crash) and it's weird because the kinect still has power, but you can see that the infrared light isn't functioning (sending out light).

i think i tried both of those solutions without success, but would be great to know if you come up with something... somebody else messaged me a while back and i posted a (non-ideal) temporary fix here that restarts the app on a schedule http://forum.processing.org/topic/exc-bad-access-sigbus-kern-protection-failure

@siusoon
Copy link

siusoon commented Feb 20, 2012

o yes..i am also planning to use your approach and start a cron job. (last resort) thanks :-) [for others who cannot install cronnix because of the old OS, you can check out this link: http://superuser.com/questions/360848/how-to-setup-a-cronjob-to-auto-download-a-file-on-mac]
Relate to my testing: Actually the longest duration that I can run is 7 hours! I have use depth = null and system.gc(), it did a better job in saving the memory leak problem.

I am doing another test, already run for 3+ hours! Seems encouraging. I suspect if you can make the kinect active at some point, it can prolong the life. e.g I wave my hand like at some point, it will run longer than just idle for 7 hours. - This needs further verification to draw this conclusion...but sort of "suspect"

Another hints is actually I am running my processing @ fps = 20, duno if this issue is affecting the performance and stability. Running this kind of stability test is just killing me, wait for many many hours...

Here is the link for some documentation and screenshot: http://www.siusoon.com/dat/2012/02/17/processing-memory-leak-issue/

@shiffman
Copy link
Owner

Still a problem? If so file a new issue in new repo:

https://github.com/shiffman/OpenKinect-for-Processing

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

3 participants