<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[ROS2 RVIZ开发，自动订阅Octomap八叉树数据，CPU占用非常高，内存泄露]]></title><description><![CDATA[<p dir="auto">预期在自己开发的QWidget中，嵌入RVIZ的渲染窗口。自定义一个widget, 继承自QWidget和WindowManagerInterface，对象initializeRVIZ的过程如下：<br />
render_penel_ = std::make_shared&lt;rviz_common::RenderPanel&gt;(this);<br />
qApp-&gt;processEvents();<br />
render_panel_-&gt;getREnderWindow()-&gt;initialize();<br />
manager_ = std::make_shared&lt;rviz_common::VisualizationManager&gt;(render_panel_.get(), rviz_ros_node_, this, clock);<br />
render_panel_-&gt;initialize(manager_.get());<br />
manager_-&gt;initialize();<br />
manager_-&gt;startUpdate();<br />
qApp-&gt;processEvents();<br />
此时，哪怕不添加任何渲染插件，都会有90%左右的CPU占用率。<br />
再添加一个八叉树数据的自动订阅和渲染。<br />
occupancy_grid_(manager_-&gt;createDisplay("octomap_rviz_plugins/OccupancyGrid", "Occupancy Grid", true))';<br />
occupancy_grid_-&gt;subProp("Topic")-&gt;setValue(“octomap/local”)；<br />
自动订阅octomap/local话题，并自动渲染八叉树，此时CPU将到180%，并且有内存泄漏。</p>
<p dir="auto">请问有什么方法可以解决CPU占用高问题和内存泄漏问题</p>
]]></description><link>https://fishros.org.cn/forum/topic/4593/ros2-rviz开发-自动订阅octomap八叉树数据-cpu占用非常高-内存泄露</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 08:54:24 GMT</lastBuildDate><atom:link href="https://fishros.org.cn/forum/topic/4593.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 21 Oct 2025 01:35:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to ROS2 RVIZ开发，自动订阅Octomap八叉树数据，CPU占用非常高，内存泄露 on Wed, 22 Oct 2025 00:40:57 GMT]]></title><description><![CDATA[<p dir="auto">CPU的问题,可以通过调整VisualizationManager的自动渲染周期解决。默认自动渲染周期为30Hz，可调成合适的10或者5Hz，可以降低一半CPU占用。<br />
但是内存泄漏一直存在。<br />
并且发现，使用rviz2的原生界面，订阅八叉树进行渲染，也会有内存泄漏</p>
]]></description><link>https://fishros.org.cn/forum/post/19156</link><guid isPermaLink="true">https://fishros.org.cn/forum/post/19156</guid><dc:creator><![CDATA[lhl911214]]></dc:creator><pubDate>Wed, 22 Oct 2025 00:40:57 GMT</pubDate></item></channel></rss>