[ros-users] Patch for memory leak in frame_common

Daniel Maturana dimatura at gmail.com
Wed Feb 2 16:36:28 UTC 2011


Hi Tully, I filed the ticket.
thanks,
Daniel

On Wed, Feb 2, 2011 at 12:28 AM, Tully Foote <tfoote at willowgarage.com> wrote:
> Hi Daniel,
>
> Thanks for the patch.  Could you file a ticket so that it doesn't get
> dropped by accident?
> https://code.ros.org/trac/ros-pkg/newticket?component=vslam
>
> Thanks,
> Tully
>
> On Tue, Feb 1, 2011 at 2:55 PM, Daniel Maturana <dimatura at gmail.com> wrote:
>>
>> Hi,
>> I'm using vslam and noticed a memory leak in
>> FrameProc::setStereoPoints. The method has a return path which fails
>> to release an allocated FrameStereo object. Since the FrameStereo
>> object has an image-sized buffer and this occurs on every frame it
>> quickly adds up to hundreds of megabytes. I checked out the last
>> version of frame.cpp from
>>
>> https://code.ros.org/svn/ros-pkg/stacks/vslam/tags/unstable/frame_common/src/frame.cpp
>> and the problem is still there. I attach a diff with the fix.
>> best,
>> Daniel Maturana
>>
>> Index: frame.cpp
>> ===================================================================
>> --- frame.cpp   (revision 35681)
>> +++ frame.cpp   (working copy)
>> @@ -34,6 +34,7 @@
>>
>>
>>  #include <frame_common/frame.h>
>> +#include <pcl/common/common.h>
>>
>>  using namespace Eigen3;
>>  using namespace std;
>> @@ -264,7 +265,10 @@
>>           frame.goodPts[i] = false;
>>       }
>>
>> -    if (!setPointCloud) return;
>> +    if (!setPointCloud) {
>> +      delete st;
>> +      return;
>> +    }
>>
>>     // convert disparities and image to point cloud with luminance/RGB
>>     double cx = frame.cam.cx;
>> _______________________________________________
>> ros-users mailing list
>> ros-users at code.ros.org
>> https://code.ros.org/mailman/listinfo/ros-users
>
>
>
> --
> Tully Foote
> Systems Engineer
> Willow Garage, Inc.
> tfoote at willowgarage.com
> (650) 475-2827
>



More information about the ros-users mailing list