<?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: restarting the cluster always running doesn't free the memory? in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111989#M44065</link>
    <description>&lt;P&gt;any suggestion Mr. &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/106294"&gt;@Alberto_Umana&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
    <pubDate>Fri, 07 Mar 2025 10:06:57 GMT</pubDate>
    <dc:creator>jeremy98</dc:creator>
    <dc:date>2025-03-07T10:06:57Z</dc:date>
    <item>
      <title>restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111710#M43976</link>
      <description>&lt;P&gt;Hello community,&lt;/P&gt;&lt;P&gt;I was working on optimising the driver memory, since there are code that are not optimised for spark, and I was planning temporary to restart the cluster to free up the memory.&lt;/P&gt;&lt;DIV class=""&gt;&lt;BR /&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2025-03-04 at 14.49.44.png" style="width: 999px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/15221i1873C8F96C0010D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2025-03-04 at 14.49.44.png" alt="Screenshot 2025-03-04 at 14.49.44.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;P&gt;that could be a potential solution, since if the cluster is not working in the first few minutes of each hour it is a good moment to restart it and free up the memory. But I was looking about the standard output and seems that is not free any memory. Why this behaviour? I need to terminate and start the cluster instead of this previous operation?&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 04 Mar 2025 13:53:30 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111710#M43976</guid>
      <dc:creator>jeremy98</dc:creator>
      <dc:date>2025-03-04T13:53:30Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111721#M43978</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133094"&gt;@jeremy98&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Generally, Databricks recommends regularly restarting clusters, particularly interactive ones, for regular clean-up. Restarting or terminating and starting the cluster anew ensures stopping all processes and freeing up memory effectively, therefore the restart should actually clean it up. You can see in your cluster metrics once it is restarted.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 14:36:24 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111721#M43978</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-03-04T14:36:24Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111723#M43980</link>
      <description>&lt;P&gt;Thanks Alberto, for the clarification! Yes, it is true, effectively, the metric UI doubled the logs for the driver and for the worker/s. I think it is a normal behaviour.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 14:48:33 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111723#M43980</guid>
      <dc:creator>jeremy98</dc:creator>
      <dc:date>2025-03-04T14:48:33Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111726#M43982</link>
      <description>&lt;P&gt;No problem, happy to assist!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 14:53:32 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111726#M43982</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-03-04T14:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111730#M43983</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi,&amp;nbsp;&lt;/STRONG&gt;I have another question: Usually, the driver should free memory by itself, but is it possible that the driver fails to do so? Why does this happen, and what issues can arise from this behavior?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 15:14:44 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111730#M43983</guid>
      <dc:creator>jeremy98</dc:creator>
      <dc:date>2025-03-04T15:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111731#M43984</link>
      <description>&lt;P&gt;Yes, it is actually possible that driver due to some reason did not free up memory.. if that happens the you will see these kind of failures:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Unresponsiveness&lt;/STRONG&gt;: The driver may become unresponsive, leading to failed health checks and potential restarts or kills by watchdog mechanisms.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Frequent Restarts&lt;/STRONG&gt;: Continuous memory pressure and GC overhead can cause the driver to restart frequently, leading to interruptions in job executions and degraded performance.&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;&lt;STRONG&gt;Out of Memory (OOM) Conditions&lt;/STRONG&gt;: Eventually, the driver might run out of memory, leading to crashes and job failures with explicit OOM errors&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 15:22:23 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111731#M43984</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-03-04T15:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111732#M43985</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Exactly, thanks, Alberto! But in general, is it best practice to restart a cluster every week to prevent this issue? Or does this problem happen because the code is not well-written?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 15:26:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111732#M43985</guid>
      <dc:creator>jeremy98</dc:creator>
      <dc:date>2025-03-04T15:26:13Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111735#M43986</link>
      <description>&lt;P&gt;It is best practice to restart the cluster regularly correct!&amp;nbsp;Regularly restarting clusters can help mitigate memory leaks and accumulated GC issues.&lt;/P&gt;
&lt;P&gt;And about if it happens because of your code, it depends on what you are doing and if you follow best practices, but would need more insights to tell.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 15:32:41 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111735#M43986</guid>
      <dc:creator>Alberto_Umana</dc:creator>
      <dc:date>2025-03-04T15:32:41Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111852#M44014</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Hi,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The code synchronizes Databricks with PostgreSQL by identifying differences and applying INSERT, UPDATE, or DELETE operations to update PostgreSQL. The steps are as follows:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Read the source data in Databricks using a simple spark.sql query.&lt;/LI&gt;&lt;LI&gt;Read the data from PostgreSQL using the JDBC driver.&lt;/LI&gt;&lt;LI&gt;Perform a JOIN operation to identify differences.&lt;/LI&gt;&lt;LI&gt;Collect the data using .collect() (I am now trying to use .toLocalIterator()).&lt;/LI&gt;&lt;LI&gt;Chunk the data and iterate over it, executing DML operations using psycopg2 in batch (extras.execute_batch()), pushing a list of tuples with page_size=1000.&lt;/LI&gt;&lt;LI&gt;…and that’s all.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Could the issue be that psycopg2 is not an API call from Databricks, so execution is handled by the driver? Or is the .collect() operation causing a bottleneck by bringing too much data to the driver at once?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Mar 2025 17:48:25 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111852#M44014</guid>
      <dc:creator>jeremy98</dc:creator>
      <dc:date>2025-03-05T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111989#M44065</link>
      <description>&lt;P&gt;any suggestion Mr. &lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/106294"&gt;@Alberto_Umana&lt;/a&gt;&amp;nbsp;?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2025 10:06:57 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/111989#M44065</guid>
      <dc:creator>jeremy98</dc:creator>
      <dc:date>2025-03-07T10:06:57Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/142807#M52023</link>
      <description>&lt;P&gt;In my case, the disk space increase event triggered causing disk space expansion, which seems fair. But, after the cluster restart, I see new instances with increased disk space only and not the default ones. This shouldn't be the case IMO.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jan 2026 08:03:43 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/142807#M52023</guid>
      <dc:creator>SwanandD</dc:creator>
      <dc:date>2026-01-02T08:03:43Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/142812#M52025</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133094"&gt;@jeremy98&lt;/a&gt;&amp;nbsp;, collect() operation brings data to the driver and yes it can cause the memory issues that you are seeing, which can cause the cluster to be hung/ crash as well if done enough times. You may confirm these instances from the cluster event logs showing "Driver is up, but not responsive. Likely due to GC".&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looking at the screenshots, you show us that there is memory pressure. So can you try reducing the GC interval from default 30 mins to 15mins.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please set configurations below in the Advanced options -&amp;gt; Spark&lt;BR /&gt;spark.cleaner.periodic.GC.interval 15min&lt;/P&gt;
&lt;P&gt;These configurations will help optimizing the GC, and clear the GC objects after every 15 minutes instead of 30 minutes(default value).&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jan 2026 08:59:13 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/142812#M52025</guid>
      <dc:creator>iyashk-DB</dc:creator>
      <dc:date>2026-01-02T08:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: restarting the cluster always running doesn't free the memory?</title>
      <link>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/142844#M52029</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/133094"&gt;@jeremy98&lt;/a&gt;&amp;nbsp;: Please review the cluster's event logs to understand the trend of the GC related issues. Example in below snapshot.&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sivaanantha_0-1767361283723.png" style="width: 400px;"&gt;&lt;img src="https://community.databricks.com/t5/image/serverpage/image-id/22638iA1BC75D72DB4CC78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sivaanantha_0-1767361283723.png" alt="sivaanantha_0-1767361283723.png" /&gt;&lt;/span&gt;&lt;BR /&gt;Typically, productive jobs are executed using Job clusters; and they stop as soon as the work is completed. Could you please explain the purpose of using Interactive cluster?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jan 2026 13:45:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/restarting-the-cluster-always-running-doesn-t-free-the-memory/m-p/142844#M52029</guid>
      <dc:creator>siva-anantha</dc:creator>
      <dc:date>2026-01-02T13:45:11Z</dc:date>
    </item>
  </channel>
</rss>

