Making a thread dump
Table of contents
Sometimes (due to some bug) DBeaver UI hangs, freezes, or works incorrectly. It is usually impossible to find the reason for such an issue without a thread dump. A thread dump is information about the internal execution state of the Java program.
DBeaver incorporates the
jstack tool for generating thread dumps. To use this pre-installed tool, it is essential to
locate its directory in the DBeaver installation and execute it from there.
jstacktool is not included in the tar.gz without Java on the DBeaver download page, and in Downstream packages.
The location of
jstack varies depending on your operating system:
For macOS and Linux
- Find the directory where DBeaver is installed. On macOS, proceed to the
Contents/Eclipsesubdirectory. Then, in both macOS and Linux systems, locate the
jre/bin/jstackdirectory. This is the typical location for
jstackin DBeaver installations.
- Find the directory where DBeaver is installed.
- Within this directory, go to
jre/bin/jstack.exe. This is the standard path to find
jstackin DBeaver installations on Windows systems.
Note: If you did not install Java during the DBeaver installation (by unchecking the
jstack.exewill not be present. In this case, you need to install Java separately and locate
jstack.exewithin the Java installation directory.
Generating a thread dump on Windows
To create a thread dump in DBeaver on Windows, follow these steps:
Find DBeaver's Process ID:
- Open Task Manager by pressing CTRL+SHIFT+ESC.
- In Windows 8 and later, switch to the "Details" tab.
DBeaver[your version]) in the process list and note its process ID (PID).
> Tip: For example, if you are using the DBeaver Lite version, you should look for
Open Command Prompt:
- Press Win+R, type
cmd, and press ENTER to open the command prompt.
- Press Win+R, type
Run the Thread Dump command:
- Navigate to the
jre/bindirectory within the DBeaver installation path.
- Run the following command, replacing
PIDwith the actual process ID of DBeaver:
`cmd jstack.exe PID > "%HOMEPATH%\dbeaver-thread-dump.txt"
- This command executes
jstack.exe, generates a thread dump for the specified PID, and saves the output to
dbeaver-thread-dump.txtin your home directory (e.g.,
C:\Users\Username). This file contains the thread dump information that can be attached to a GitHub issue for further analysis.
- Navigate to the
Generating a thread dump on Mac and Linux
To create a thread dump in DBeaver on macOS and Linux systems, you can use the included
jstack tool via the terminal. The
following script will generate a thread dump and save it as
dbeaver-thread-dump.txt in your home directory:
/Applications/YOUR-VERSION-OF-DBEAVER.app/Contents/Eclipse/jre/Contents/Home/bin/jstack $(pgrep dbeaver) > ~/dbeaver-thread-dump.txt
YOUR-VERSION-OF-DBEAVER.appwith the version of DBeaver you have installed. For example, if you have DBeaver Lite version, the path would be
Generating a thread dump without Java
For Linux users
If you are running DBeaver on Linux using the tar.gz version without Java included, you will need to install the Java Development Kit (JDK) to generate a thread dump. Follow these steps:
Check for Existing JDK Installation:
- Open your terminal.
which jstackand press Enter.
- If the JDK is installed, a version number will appear.
- If JDK is not installed, you need to install it.
- Use your distribution's package manager to install JDK. For example, on Ubuntu, you can
sudo apt install default-jdk.
After successfully installing JDK, proceed with the thread dump script:
jstack $(pgrep dbeaver) > ~/dbeaver-thread-dump.txt
After running this script, you will find the
dbeaver-thread-dump.txt file in your home directory, containing the
necessary thread information for diagnosing issues.
For Windows users
If you are using DBeaver on Windows without Java, consider installing Adoptium OpenJDK.
Alternatively, you can reinstall DBeaver and ensure to check the
Install Java checkbox during installation.
After installing Java through either method, you can follow the instructions in the section Generating a Thread Dump on Windows to successfully generate a thread dump.