โ02-02-2023 07:00 AM
Hi everyone!
I have a question. For a project I need to establish a jdbc connection using spark.read. My question is when does the connection is deleted. That is because I will read multiple tables from that database, so if I could just create a connection and then reuse, it would be better.
If this does not work, is the method dbutils.notebook.exit() able to clean memory on the JVM used and in consequence delete the connection?
โ02-02-2023 09:59 AM
@Joรฃo Peixotoโ - Please use %scala System.gc() to explicitly release the free memory from JVM. Please note: JVM process won't explicitly releases memory back as it is an expensive process to request memory again.
โ02-02-2023 10:13 AM
Hi Shan!
First, thank you for your help. I cannot use scala, because the cluster used is a shared cluster. Can I do the same using python?
โ02-08-2023 11:05 PM
Hi @Joรฃo Peixotoโ
Hope all is well! Just wanted to check in if you were able to resolve your issue and would you be happy to share the solution or mark an answer as best? Else please let us know if you need more help.
We'd love to hear from you.
Thanks!
โ02-09-2023 01:21 AM
Hi Vidula!
I havenยดt figure out a solution yet, so any help would be appreciated
Thank you!
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโt want to miss the chance to attend and share knowledge.
If there isnโt a group near you, start one and help create a community that brings people together.
Request a New Group