How to reduce unnecessary high memory usage in a Databricks cluster?

Senad Hadzikic 20 Reputation points
2024-05-08T08:58:46.4433333+00:00

We are having unnecessary high memory usage even when nothing is running on the cluster. When the cluster first starts, it's fine, but when I run a script and it finishes executing, nothing gets back to the idle (initial) state (even hours after nothing else was executed).

Screenshot 2024-05-08 at 10.53.08

Cluster config:
Screenshot 2024-05-08 at 10.56.09

Some settings i tried:
Screenshot 2024-05-08 at 10.56.41

Spark Config:
spark.executor.extraJavaOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -XX:ParallelGCThreads=20 -XX:ConcGCThreads=5 -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:G1HeapRegionSize=8M spark.memory.storageFraction 0.5 spark.dynamicAllocation.maxExecutors 10 spark.driver.extraJavaOptions -XX:+UseG1GC -XX:MaxGCPauseMillis=500 -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=10M -Xloggc:/databricks/driver/logs/gc.log -XX:G1HeapRegionSize=8M -XX:+ExplicitGCInvokesConcurrent spark.dynamicAllocation.enabled true spark.memory.fraction 0.6 spark.dynamicAllocation.minExecutors 1

Azure Databricks
Azure Databricks

An Apache Spark-based analytics platform optimized for Azure.

Azure | Azure Startups
Azure | Azure Startups

Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.


7 answers

Sort by: Newest
  1. Achilleas Stefanidis 0 Reputation points
    2025-03-31T07:24:08.4766667+00:00

    +1

    We have the same situation.

    Was this answer helpful?


  2. Abhishek Negi 0 Reputation points
    2024-09-17T19:07:20.47+00:00

    I have a possibly worse situation, my brand new cluster memory gets 80-90% Used or Buffered as soon as the cluster is created. Even if nothing has been run on the cluster and no library has been installed. Can someone please help in finding out how this memory is getting consumed and a solution? Tried restarting but memory immediately fills up as soon as cluster is started.

    User's image

    Was this answer helpful?


  3. Alex 0 Reputation points
    2024-08-05T19:59:13.4333333+00:00

    Hi @PRADEEPCHEEKATLA , anybody at Microsoft looking into this? If not, can you point us to the right Databricks forum/contact. It's been months without a solution.

    Was this answer helpful?

    0 comments No comments

  4. Alex 0 Reputation points
    2024-07-08T00:53:04.0066667+00:00

    Same problem here, I did the same as the user in the last comment, increased the cluster memory. But it still shows almost 100% memory utilization long after the script in a Notebook has completed. Ironically, clearing the cache does not help. Only way to solve it is to restart the cluster.

    User's image

    Was this answer helpful?

    0 comments No comments

  5. Luigi Greselin 5 Reputation points
    2024-06-18T07:47:33.34+00:00

    I am experiencing the same problem. I even switched from a 28 Gb Memory cluster to a 56 Gb. It gets completely full after the first run

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.