美文网首页ROS
Valgrind ROS 内存泄漏查找

Valgrind ROS 内存泄漏查找

作者: dopami | 来源:发表于2018-05-26 11:27 被阅读39次

    ROS中用到第三方库,在编译第三方库的时候,加上 -g 选项,以供调用该库时调试。

    在编译ROS包的时候,使用如下命令编译:

    catkin_make -DCMAKE_BUILD_TYPE=Debug  

    1、打开roscore 

    $  roscore

    2、用valgrind打开程序

    $ valgrind --tool=memcheck --leak-check=yes --log-file=valgrind.log ./devel/lib/package_foo/executable_bar


    you will not get useful memory stats. I believe this is due to rosrun spawning your node in a separate process. To get around this, you can call your executable directly: 

    $ valgrind --tool=memcheck --leak-check=yes --log-file=valgrind.log rosrun package_foo executable_bar,

    Alternatively, you could write your own launchfile with Valgrind in the launch-prefix.

    相关文章

      网友评论

        本文标题:Valgrind ROS 内存泄漏查找

        本文链接:https://www.haomeiwen.com/subject/ejqmjftx.html