<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Possible memory leak with Dictionary Renderer and very dynamic attributes in Qt Maps SDK Questions</title>
    <link>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1665388#M5525</link>
    <description>&lt;P&gt;Thank you for looking into it. I made the example a bit more extreme and let it run over night. When I came in the morning the PC seems to have crashed in the night. In the Event Viewer I could see a "Resource-Exhaustion-Detector" Event indicating the process took at one point close to 48GB of RAM:&lt;/P&gt;&lt;P&gt;`Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: Playground.exe (1060324) consumed 47701180416 bytes`&lt;/P&gt;&lt;P&gt;Here is the code for the more "extreme" example where even more attributes are set.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;namespace
{
const std::vector&amp;lt;std::string&amp;gt; identifications{"0", "1", "2", "3", "4", "5"};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; identification_distribution{0, identifications.size() - 1};
const std::vector&amp;lt;std::string&amp;gt; mainIcons{
	"000000",
	"110000",
	"110100",
	"110101",
	"110102",
	"110103",
	"110104",
	"110105",
	"110107",
	"110116",
	"110200"};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; mainIcon_distribution{0, mainIcons.size() - 1};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; azimuth_distribution{0, 360};
const std::vector&amp;lt;std::string&amp;gt; modifiers{"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10"};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; modifiers_distribution{0, modifiers.size() - 1};
} // namespace

	QTimer* timer = new QTimer(this);
	connect(timer, &amp;amp;QTimer::timeout, this, [this] {
		for (auto graphic : *m_graphicsOverlay-&amp;gt;graphics()) {
			QVariantMap attributes;
			const auto&amp;amp; identification = identifications[identification_distribution(m_generator)];
			const auto&amp;amp; mainIcon = mainIcons[mainIcon_distribution(m_generator)];
			const auto&amp;amp; modifier1 = modifiers[modifiers_distribution(m_generator)];
			const auto&amp;amp; modifier2 = modifiers[modifiers_distribution(m_generator)];
			auto sidc = "140" + identification + "010000" + mainIcon + "00" + modifier1 + modifier2;
			attributes["sidc"] = QString::fromStdString(sidc);
			auto randomX = 8.5417 + (9.2417 - 8.5417) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX;
			auto randomY = 47.3769 + (46.3769 - 47.3769) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX;
			// attributes["direction"] = QString::number(static_cast&amp;lt;int&amp;gt;(azimuth_distribution(m_generator)) - 180);
			//  qDebug() &amp;lt;&amp;lt; attributes["direction"];
			attributes["direction"] =
				QString::number(180.0 + (-180.0 - 180.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["speed"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["staffcomment"] =
				QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["uniquedesignation"] =
				QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["additionalinformation"] =
				QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["x"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["y"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["z"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["z2"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			auto point = Point(randomX, randomY, m_spatialReference);
			graphic-&amp;gt;attributes()-&amp;gt;setAttributesMap(attributes);
			graphic-&amp;gt;setGeometry(point);
		}
	});
	timer-&amp;gt;start(100);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Nov 2025 08:55:17 GMT</pubDate>
    <dc:creator>imbachb</dc:creator>
    <dc:date>2025-11-13T08:55:17Z</dc:date>
    <item>
      <title>Possible memory leak with Dictionary Renderer and very dynamic attributes</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1664928#M5523</link>
      <description>&lt;P&gt;We are experiencing a possible memory leak when using the dictionary renderer and very dynamic attributes. We are using the APP-6(E) dictionary style downloaded from&amp;nbsp;&lt;A href="https://www.arcgis.com/home/group.html?id=07dd0bdb5ea441269a05a502508eb499" target="_blank" rel="noopener"&gt;https://www.arcgis.com/home/group.html?id=07dd0bdb5ea441269a05a502508eb499&lt;/A&gt;&lt;/P&gt;&lt;P&gt;We're updating the attributes of existing graphics on a defined tick.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;QVariantMap attributes;
attributes["speed"] = someObj.getSpeed();
graphic-&amp;gt;attributes()-&amp;gt;setAttributesMap(attributes);&lt;/LI-CODE&gt;&lt;P&gt;In general we noticed that the used memory depends on how varied the attributes are, i.e. the more varied the attributes, the more memory will be used over time. In above case for example, the speed can take many different values. Since our applications must run for multiple days we noticed that the memory consumption kept increasing with such dynamic attributes.&lt;/P&gt;&lt;P&gt;To analyze this issue we created a bit of an extreme test case where we update all the graphics with a varied set of random attributes:&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;	QTimer* timer = new QTimer(this);
	connect(timer, &amp;amp;QTimer::timeout, this, [this] {
		for (auto graphic : *m_graphicsOverlay-&amp;gt;graphics()) {
			QVariantMap attributes;
			auto identification = identifications[identification_distribution(m_generator)];
			auto mainIcon = mainIcons[mainIcon_distribution(m_generator)];
			auto sidc = "140" + identification + "010000" + mainIcon + "000000";
			attributes["sidc"] = QString::fromStdString(sidc);
			auto randomX = 8.5417 + (9.2417 - 8.5417) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX;
			auto randomY = 47.3769 + (46.3769 - 47.3769) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX;
			attributes["direction"] =
				QString::number(180.0 + (-180.0 - 180.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["speed"] = QString::number(10000.0 + (0.0 - 10000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["staffcomment"] =
				QString::number(10000.0 + (0.0 - 10000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["uniquedesignation"] =
				QString::number(10000.0 + (0.0 - 10000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["additionalinformation"] =
				QString::number(10000.0 + (0.0 - 10000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			auto point = Point(randomX, randomY, m_spatialReference);
			graphic-&amp;gt;attributes()-&amp;gt;setAttributesMap(attributes);
			graphic-&amp;gt;setGeometry(point);
		}
	});
	timer-&amp;gt;start(100);&lt;/LI-CODE&gt;&lt;P&gt;We let this run for a while and noticed that the memory keeps increasing, seemingly unbound. Pure speculation: It seems as if the symbol variants are getting cached, but since there is a nigh infinite amount of combinations, the cache keeps increasing in size.&lt;/P&gt;&lt;P&gt;We also did some heap snapshots to see if we can identify the issue:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="imbachb_1-1762875165437.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143591iD8503CE14AE1B058/image-size/medium?v=v2&amp;amp;px=400" role="button" title="imbachb_1-1762875165437.png" alt="imbachb_1-1762875165437.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="imbachb_2-1762875172295.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143592i01C0E4D5988CBDAA/image-size/large?v=v2&amp;amp;px=999" role="button" title="imbachb_2-1762875172295.png" alt="imbachb_2-1762875172295.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="imbachb_0-1762875140905.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/143590i7CF4E4AF4423B476/image-size/large?v=v2&amp;amp;px=999" role="button" title="imbachb_0-1762875140905.png" alt="imbachb_0-1762875140905.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As you can see in the stacks, code regarding the symbols was the cause of most new allocations.&lt;/P&gt;&lt;P&gt;Please find attached a more complete source code example. The example code does following:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a dictionary renderer using the app-6e stylx.&lt;/LI&gt;&lt;LI&gt;Add 200 graphics at random positions&lt;/LI&gt;&lt;LI&gt;Update attributes of all graphics on a timer&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;We are using Windows 10, ArcGIS Maps SDK for Qt 200.8, and &lt;SPAN&gt;DirectX&amp;nbsp;&lt;/SPAN&gt;rendering API.&lt;/P&gt;&lt;P&gt;Is there anything we can do to stop this increase of memory used while keeping the varied attributes?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2025 15:50:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1664928#M5523</guid>
      <dc:creator>imbachb</dc:creator>
      <dc:date>2025-11-11T15:50:41Z</dc:date>
    </item>
    <item>
      <title>Re: Possible memory leak with Dictionary Renderer and very dynamic attributes</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1665229#M5524</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/710993"&gt;@imbachb&lt;/a&gt;&amp;nbsp;thanks for reporting this and sharing the code snippets. That helps make things easier for us to reproduce. We will investigate soon and let you know what we find.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 18:49:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1665229#M5524</guid>
      <dc:creator>JamesBallard1</dc:creator>
      <dc:date>2025-11-12T18:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: Possible memory leak with Dictionary Renderer and very dynamic attributes</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1665388#M5525</link>
      <description>&lt;P&gt;Thank you for looking into it. I made the example a bit more extreme and let it run over night. When I came in the morning the PC seems to have crashed in the night. In the Event Viewer I could see a "Resource-Exhaustion-Detector" Event indicating the process took at one point close to 48GB of RAM:&lt;/P&gt;&lt;P&gt;`Windows successfully diagnosed a low virtual memory condition. The following programs consumed the most virtual memory: Playground.exe (1060324) consumed 47701180416 bytes`&lt;/P&gt;&lt;P&gt;Here is the code for the more "extreme" example where even more attributes are set.&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;namespace
{
const std::vector&amp;lt;std::string&amp;gt; identifications{"0", "1", "2", "3", "4", "5"};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; identification_distribution{0, identifications.size() - 1};
const std::vector&amp;lt;std::string&amp;gt; mainIcons{
	"000000",
	"110000",
	"110100",
	"110101",
	"110102",
	"110103",
	"110104",
	"110105",
	"110107",
	"110116",
	"110200"};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; mainIcon_distribution{0, mainIcons.size() - 1};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; azimuth_distribution{0, 360};
const std::vector&amp;lt;std::string&amp;gt; modifiers{"00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10"};
std::uniform_int_distribution&amp;lt;std::size_t&amp;gt; modifiers_distribution{0, modifiers.size() - 1};
} // namespace

	QTimer* timer = new QTimer(this);
	connect(timer, &amp;amp;QTimer::timeout, this, [this] {
		for (auto graphic : *m_graphicsOverlay-&amp;gt;graphics()) {
			QVariantMap attributes;
			const auto&amp;amp; identification = identifications[identification_distribution(m_generator)];
			const auto&amp;amp; mainIcon = mainIcons[mainIcon_distribution(m_generator)];
			const auto&amp;amp; modifier1 = modifiers[modifiers_distribution(m_generator)];
			const auto&amp;amp; modifier2 = modifiers[modifiers_distribution(m_generator)];
			auto sidc = "140" + identification + "010000" + mainIcon + "00" + modifier1 + modifier2;
			attributes["sidc"] = QString::fromStdString(sidc);
			auto randomX = 8.5417 + (9.2417 - 8.5417) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX;
			auto randomY = 47.3769 + (46.3769 - 47.3769) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX;
			// attributes["direction"] = QString::number(static_cast&amp;lt;int&amp;gt;(azimuth_distribution(m_generator)) - 180);
			//  qDebug() &amp;lt;&amp;lt; attributes["direction"];
			attributes["direction"] =
				QString::number(180.0 + (-180.0 - 180.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["speed"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["staffcomment"] =
				QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["uniquedesignation"] =
				QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["additionalinformation"] =
				QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["x"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["y"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["z"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			attributes["z2"] = QString::number(100000.0 + (0.0 - 100000.0) * static_cast&amp;lt;double&amp;gt;(rand()) / RAND_MAX);
			auto point = Point(randomX, randomY, m_spatialReference);
			graphic-&amp;gt;attributes()-&amp;gt;setAttributesMap(attributes);
			graphic-&amp;gt;setGeometry(point);
		}
	});
	timer-&amp;gt;start(100);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 08:55:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1665388#M5525</guid>
      <dc:creator>imbachb</dc:creator>
      <dc:date>2025-11-13T08:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Possible memory leak with Dictionary Renderer and very dynamic attributes</title>
      <link>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1668277#M5527</link>
      <description>&lt;P&gt;we've logged the following bug in our system -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;BUG-000181142: Memory leak with Dictionary Renderer and very dynamic attributes&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are interested, you can contact your Esri Distributor to get your customer account attached to the bug. This way you will be in the system and get updates as there is progress to report.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 18:45:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/qt-maps-sdk-questions/possible-memory-leak-with-dictionary-renderer-and/m-p/1668277#M5527</guid>
      <dc:creator>LucasDanzinger</dc:creator>
      <dc:date>2025-11-24T18:45:39Z</dc:date>
    </item>
  </channel>
</rss>

