<?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 Photon running out of memory error while executing SQL on SQL Serverless warehouse in Warehousing &amp; Analytics</title>
    <link>https://community.databricks.com/t5/warehousing-analytics/photon-running-out-of-memory-error-while-executing-sql-on-sql/m-p/130723#M2215</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Photon ran out of memory while executing this query. Photon failed to reserve 32.0 KiB for BufferPool, in BroadcastBufferedRelation(spark_plan_id=13407). Memory usage: Total task memory (including non-Photon): 1829.7 MiB BroadcastBufferedRelation(spark_plan_id=13407): allocated 1701.7 MiB, tracked 1701.7 MiB, untracked allocated 0.0 B, peak 1701.7 MiB BufferPool: allocated 1701.7 MiB, tracked 1701.7 MiB, untracked allocated 0.0 B, peak 1701.7 MiB AppendableMemoryPool: allocated 0.0 B, tracked 0.0 B, untracked allocated 0.0 B, peak 0.0 B Memory consumers: Acquired by com.databricks.photon.NativeMemoryConsumer@2a146bb: 1829.7 MiB&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Sep 2025 19:02:47 GMT</pubDate>
    <dc:creator>vijamit</dc:creator>
    <dc:date>2025-09-03T19:02:47Z</dc:date>
    <item>
      <title>Photon running out of memory error while executing SQL on SQL Serverless warehouse</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/photon-running-out-of-memory-error-while-executing-sql-on-sql/m-p/130723#M2215</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Photon ran out of memory while executing this query. Photon failed to reserve 32.0 KiB for BufferPool, in BroadcastBufferedRelation(spark_plan_id=13407). Memory usage: Total task memory (including non-Photon): 1829.7 MiB BroadcastBufferedRelation(spark_plan_id=13407): allocated 1701.7 MiB, tracked 1701.7 MiB, untracked allocated 0.0 B, peak 1701.7 MiB BufferPool: allocated 1701.7 MiB, tracked 1701.7 MiB, untracked allocated 0.0 B, peak 1701.7 MiB AppendableMemoryPool: allocated 0.0 B, tracked 0.0 B, untracked allocated 0.0 B, peak 0.0 B Memory consumers: Acquired by com.databricks.photon.NativeMemoryConsumer@2a146bb: 1829.7 MiB&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 19:02:47 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/photon-running-out-of-memory-error-while-executing-sql-on-sql/m-p/130723#M2215</guid>
      <dc:creator>vijamit</dc:creator>
      <dc:date>2025-09-03T19:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: Photon running out of memory error while executing SQL on SQL Serverless warehouse</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/photon-running-out-of-memory-error-while-executing-sql-on-sql/m-p/130724#M2216</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/136770"&gt;@vijamit&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How can we help you?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Sep 2025 19:25:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/photon-running-out-of-memory-error-while-executing-sql-on-sql/m-p/130724#M2216</guid>
      <dc:creator>Khaja_Zaffer</dc:creator>
      <dc:date>2025-09-03T19:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Photon running out of memory error while executing SQL on SQL Serverless warehouse</title>
      <link>https://community.databricks.com/t5/warehousing-analytics/photon-running-out-of-memory-error-while-executing-sql-on-sql/m-p/130725#M2217</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/136770"&gt;@vijamit&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Good day!!&lt;/P&gt;&lt;P&gt;It was very hard to analyise the error but :&amp;nbsp;&lt;/P&gt;&lt;P&gt;The causes for the error shared are : Your query has run out of memory during execution, specifically when using the&amp;nbsp;BuildHashedRelation&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;PartitionedRelation&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;functions.&lt;/P&gt;&lt;P&gt;Running out of memory happens when memory is improperly allocated during query execution. The Photon cluster relies on accurate table statistics to optimize query execution and manage memory usage. When the statistics are incorrect, Photon may allocate insufficient memory for the query, resulting in an&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Out of Memory&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;error.&lt;/P&gt;&lt;P&gt;Additionally, memory management issues can occur when:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Queries have multiple joins, subqueries, or aggregations, which increases the complexity of memory management. This makes it more challenging for Photon to accurately estimate memory needs.&lt;/LI&gt;&lt;LI&gt;You’re working with large datasets, which increases the likelihood of encountering an out-of-memory error. Photon may underestimate the memory required to process the data.&lt;/LI&gt;&lt;LI&gt;You work with dependencies such as outdated libraries or incompatible versions, which also contribute to memory management problems in Photon.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Expected solution:&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Ensure that all tables involved in the query have up-to-date statistics. Execute&amp;nbsp;ANALYZE TABLE COMPUTE STATISTICS&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;on each table to recompute and update the statistics.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;ANALYZE&amp;nbsp;TABLE&amp;nbsp;&amp;lt;table-name&amp;gt;&amp;nbsp;COMPUTE&amp;nbsp;STATISTICS;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;If possible, simplify complex queries by breaking them down into smaller, more manageable parts. This can help Photon better estimate memory requirements and reduce the likelihood of an out-of-memory error.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Upgrade to Databricks Runtime 13.3 LTS or above. There is a new feature added to Databricks Runtime versions starting with 13.3 LTS that helps mitigate this issue.&amp;nbsp;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Wed, 03 Sep 2025 19:37:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/warehousing-analytics/photon-running-out-of-memory-error-while-executing-sql-on-sql/m-p/130725#M2217</guid>
      <dc:creator>Khaja_Zaffer</dc:creator>
      <dc:date>2025-09-03T19:37:52Z</dc:date>
    </item>
  </channel>
</rss>

