@karlson's answer is great, you could also use Spark UI.
- Start the Spark UI: When you launch your Spark application, a web interface is typically started.
- Navigate to the "Executors" tab: This tab provides information about the executors running your application, including their memory usage. You can see the total memory allocated to each executor, as well as the memory used by different components like the JVM heap, storage, and other overhead.