PTC Arbortext Content Delivery Deployment > Generating Core Dumps from Code
Generating Core Dumps from Code
You can generate core dumps from within the code for debugging and troubleshooting.
To dump the core of a running process, perform the following steps:
For Windows: Right-click a process in the Task Manager, and select Create Dump File.
For Linux: Run the following command:
gcore <pid>
To collect the JBoss and CoreServer dump files perform the following steps:
1. Collect the JBoss thread dump files from Publisher and Viewer machines.
On Linux:
1. To determine the Process ID for the JBoss process, run the following command: ps -ef | grep jboss
Here, the first column is the user name that the process is running as and the second column is the process ID.
2. Open the terminal window and change the directory to <JAVA_HOME>/bin
3. Ensure that the JAVA_HOME environment variables are set as follows:
export JAVA_HOME=<Location>/Java/jdk1.8.0_144
export PATH=$JAVA_HOME/bin;$PATH
4. Run the command: jstack -l <JBoss_process_id> >> <Output_filename.log>
5. To collect the CPU and heap usage, run the command: jmap -dump:live,format=b,file=<any_desired_path>.hprof <Jboss_process_id>
On Windows:
1. To determine the Process ID for the JBoss process, open the Windows Task Manager and browse to the Processes tab.
* 
In some versions of Windows, you must click More details to expand the Task Manager view and display the tabs.
2. Fetch the Process ID of the JBoss service. If there is no JBoss process, identify the java.exe process and find the JBoss process id.
3. Open the command window and change the directory to <JAVA_HOME>/bin
4. Ensure that the JAVA_HOME environment variables are set as follows:
set JAVA_HOME=<Location>/Java/jdk1.8.0_144
set PATH=$JAVA_HOME/bin;$PATH
5. Run the command: jstack -l <JBoss_process_id> >> <Output_filename.log>
6. To collect the CPU and heap usage, run the command: jmap -dump:live,format=b,file=<any_desired_path>.hprof <Jboss_process_id>
2. Collect the CoreServer thread dump files from Publisher and Viewer machines.
On Linux:
1. To determine the Process ID for the CoreServer process, run the following command: ps -ef | grep CoreServer
Here, the first column is the user name that the process is running as and the second column is the process ID.
2. To generate the core.<proc_id> file in the current directory, Open the command window and run the gcore <CoreServer_process_id> command.
3. Generate the pstack based on the generated gcore file by using the command: pstack core.<proc_id> >> <Output_filename.log>
4. Follow the same steps for the CoreServerCMI process.
On Windows:
1. To determine the Process ID for the CoreServer process, open the Windows Task Manager and browse to the Processes tab.
2. Right-click coreServer.exe and select Create Dump File.
3. If you are prompted for an administrator password or confirmation, type your password or click Continue. A dump file for the process is created in the drive:\Users\UserName\AppData\Local\Temp folder.
4. After you receive a message that states that the dump file was successfully created, note the location, and click OK.
5. Follow the same steps for the CoreServerCMI process.