elliotwoods / ofxSquash

Compress and decompress data using a large range of compression codecs supplied by libsquash
29 stars 9 forks source link

Memory Leak with density codec #11

Open galsasson opened 8 years ago

galsasson commented 8 years ago

Hi, I'm getting a major memory leak when using ofxSquashBuddies to stream Kinect data using the density codec. Profiling with Instruments pointed at the density codec plugin in the function density_decode_init.

screen shot 2016-08-30 at 12 12 28 pm

I saw your report on this issue here: https://github.com/quixdb/squash/issues/198 and here: https://github.com/centaurean/density/issues/53

Was wondering if you found a solution to this issue, or have an idea for a workaround.

Thanks and thanks for the super useful addons.

elliotwoods commented 8 years ago

Hey! Glad to hear you're trying this out Also that you've got it running with OSX!

For a recent project I switched to LZ4 compression because of the memory leak issue.

In some situations density is still workable (it leaks memory whenever there's dropped packets, and on some stream connections there just aren't that many and especially if the session isn't that long like a performance)

Do you know how to change the codec?

galsasson commented 8 years ago

Thanks for the quick response! If I remember correctly setting it up on OSX was fairly straight forward, I'm using it for development, the production app will run on a Windows machine. The project that I'm working on needs to run though the day 7 days a week so I will switch to LZ4.

I didn't look yet on how to change the codec, any help would be appreciated.

Thanks!

elliotwoods commented 8 years ago

Both ofxSquashBuddies::Sender and Receiver have the following functions:

https://github.com/elliotwoods/ofxSquashBuddies/blob/master/src/ofxSquashBuddies/ThingsInCommon.h

i.e. you can call setCodec(...)