Re: [ros-users] Patch for memory leak in frame_common

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: User discussions
Date:  
To: dimatura, User discussions
Subject: Re: [ros-users] Patch for memory leak in frame_common
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 <> 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
> 
> https://code.ros.org/mailman/listinfo/ros-users

>




--
Tully Foote
Systems Engineer
Willow Garage, Inc.

(650) 475-2827