From 3acdbc1b50db13be40579ebdd16511a1bf577b05 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Thu, 5 Sep 2024 06:38:24 +0000 Subject: [PATCH 01/11] added section about managed memory dumping --- docs/general/server/memory-dumping.md | 101 ++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 docs/general/server/memory-dumping.md diff --git a/docs/general/server/memory-dumping.md b/docs/general/server/memory-dumping.md new file mode 100644 index 000000000..619496695 --- /dev/null +++ b/docs/general/server/memory-dumping.md @@ -0,0 +1,101 @@ +--- +uid: server-memorydumps +title: Server Memory Dumps +--- + +# Memory Dumping of the Jellyfin server + +To troubleshoot a jellyfin server that keeps allocating system memory it is nessesary to dump the memory in a format that the developers then can later analyse. + +To dump the memory we use the dotMemory tools from Jetbrains. + +## Linux Barebones + +First we need to install the latest dotMemory commandline tooling. +To do this we pull the nuget package and extract it to a folder named `dotMemoryClt` and then set the permissions to be executable: + +```sh +apt-get update -y && apt-get install -y wget && \ +wget -O dotMemoryclt.zip https://www.nuget.org/api/v2/package/JetBrains.dotMemory.Console.linux-x64/2024.2.2 && \ +apt-get install -y unzip && \ +unzip dotMemoryclt.zip -d ./dotMemoryclt && \ +chmod +x -R dotMemoryclt/* +``` + +afterwards we need to figure out the process ID of the jellyfin server via + +```sh +ps aux +``` + +If the ps command is not available in your Linux distribution, install it with: + +```sh +apt-get update && apt-get install procps +``` + +this will show us a number of processes like this: + +```cmd +# ps aux +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +root 1 1.8 7.4 276905428 2304952 ? Ssl Sep04 17:23 /jellyfin/jellyfin +root 914 0.0 0.0 2480 580 pts/0 Ss 05:33 0:00 sh +root 2171 0.0 0.0 6756 2940 pts/0 R+ 12:55 0:00 ps aux +``` + +Now we note the process ID (PID) of the jellyfin server. That is the process that has the `/jellyfin/jellyfin` command. The left part of the path might differ if you have installed jellyfin in a different directory but the most right part of the path should always be `/jellyfin`. + +Then we run the memory profiler via this command with the `{PID}` replaced by the pid we noted earlier (In this case it would be 1): + +```sh +/dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all +``` + +this will then start the profiler, attach it to the jellyfin process, make a memory dump and wait. After you see the output of: + +```sh +[PID:{PID}] SNAPSHOT #1 READY. +``` + +press `CTRL+C` or wait for 1 minute. You then get the information that the profiler ended and where the file was saved like this: + +```sh +Profiler disconnected. PID:{PID} +Saving workspace... +WORKSPACE SAVED +file:///temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw +``` + +You must now upload the created file, in this case `/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` and provide it to the jellyfin developers. + +## Docker + +The docker process is essentially the same as the linux barebones, plus you need to install `ps` every time and you need to pull the result file from the container. + +First you need to figure out the ID of your jellyfin process by running + +```sh +docker ps +``` + +this will show you all your docker containers: + +```sh +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +31e5d4f30c8b jellyfin/jellyfin:10.9.9 "/jellyfin/jellyfin" 15 hours ago Up 15 hours (healthy) 8096/tcp +``` + +write down the `CONTAINER ID` and then attach your current console to that container via + +```sh +docker exec -it {CONTAINERID} sh +``` + +so for example `docker exec -it 31e5d4f30c8b sh`. Then follow all the steps from the Linux Barebones guide above. After that you might want to transfer the result file back to your host, assuming the same result file from the above example you can do that on your host by calling: + +```ps +docker cp {CONTAINERID}:/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw /opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw +``` + +you can then proceed to upload the `/opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` result file and provide it to the jellyfin developers. From cd14104b32a600291de1f2cc3ec7011ea7b1f595 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Thu, 5 Sep 2024 06:41:30 +0000 Subject: [PATCH 02/11] Fixed linter --- docs/general/server/memory-dumping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/server/memory-dumping.md b/docs/general/server/memory-dumping.md index 619496695..6cfe45db3 100644 --- a/docs/general/server/memory-dumping.md +++ b/docs/general/server/memory-dumping.md @@ -73,7 +73,7 @@ You must now upload the created file, in this case `/temp/dotMemoryclt/workspace The docker process is essentially the same as the linux barebones, plus you need to install `ps` every time and you need to pull the result file from the container. -First you need to figure out the ID of your jellyfin process by running +First you need to figure out the ID of your jellyfin process by running: ```sh docker ps From 8973a33d1af3027b2dfa68e0f56b9d4efea028f6 Mon Sep 17 00:00:00 2001 From: JPVenson Date: Thu, 5 Sep 2024 12:16:51 +0000 Subject: [PATCH 03/11] moved section next to thoubleshooting --- docs/general/{server => administration}/memory-dumping.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/general/{server => administration}/memory-dumping.md (100%) diff --git a/docs/general/server/memory-dumping.md b/docs/general/administration/memory-dumping.md similarity index 100% rename from docs/general/server/memory-dumping.md rename to docs/general/administration/memory-dumping.md From 1fd0fefcf0f6a3df7725c1dab4770fb5fc190657 Mon Sep 17 00:00:00 2001 From: felix920506 Date: Thu, 12 Sep 2024 15:48:17 -0400 Subject: [PATCH 04/11] move mem dump under troubleshooting --- .../{troubleshooting.md => troubleshooting/index.md} | 0 .../administration/{ => troubleshooting}/memory-dumping.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename docs/general/administration/{troubleshooting.md => troubleshooting/index.md} (100%) rename docs/general/administration/{ => troubleshooting}/memory-dumping.md (100%) diff --git a/docs/general/administration/troubleshooting.md b/docs/general/administration/troubleshooting/index.md similarity index 100% rename from docs/general/administration/troubleshooting.md rename to docs/general/administration/troubleshooting/index.md diff --git a/docs/general/administration/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md similarity index 100% rename from docs/general/administration/memory-dumping.md rename to docs/general/administration/troubleshooting/memory-dumping.md From e673ffd61e6cff09d7bcdba8685f925c97d424b9 Mon Sep 17 00:00:00 2001 From: felix920506 Date: Thu, 12 Sep 2024 19:32:13 -0400 Subject: [PATCH 05/11] typos, capitalization etc. --- .../troubleshooting/memory-dumping.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/general/administration/troubleshooting/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md index 6cfe45db3..d7bcefcd5 100644 --- a/docs/general/administration/troubleshooting/memory-dumping.md +++ b/docs/general/administration/troubleshooting/memory-dumping.md @@ -5,14 +5,14 @@ title: Server Memory Dumps # Memory Dumping of the Jellyfin server -To troubleshoot a jellyfin server that keeps allocating system memory it is nessesary to dump the memory in a format that the developers then can later analyse. +To troubleshoot a Jellyfin server that keeps allocating system memory it is necessary to dump the memory in a format that the developers then can later analyze. -To dump the memory we use the dotMemory tools from Jetbrains. +To dump the memory we will use the dotMemory tools from JetBrains. ## Linux Barebones -First we need to install the latest dotMemory commandline tooling. -To do this we pull the nuget package and extract it to a folder named `dotMemoryClt` and then set the permissions to be executable: +First, we need to install the latest dotMemory command line tooling. +To do this, pull the nuget package and extract it to a folder named `dotMemoryClt` and then set the permissions to be executable: ```sh apt-get update -y && apt-get install -y wget && \ @@ -22,7 +22,7 @@ unzip dotMemoryclt.zip -d ./dotMemoryclt && \ chmod +x -R dotMemoryclt/* ``` -afterwards we need to figure out the process ID of the jellyfin server via +afterwards we need to figure out the process ID of the Jellyfin server: ```sh ps aux @@ -34,7 +34,7 @@ If the ps command is not available in your Linux distribution, install it with: apt-get update && apt-get install procps ``` -this will show us a number of processes like this: +This will show us a number of processes like this: ```cmd # ps aux @@ -44,7 +44,7 @@ root 914 0.0 0.0 2480 580 pts/0 Ss 05:33 0:00 sh root 2171 0.0 0.0 6756 2940 pts/0 R+ 12:55 0:00 ps aux ``` -Now we note the process ID (PID) of the jellyfin server. That is the process that has the `/jellyfin/jellyfin` command. The left part of the path might differ if you have installed jellyfin in a different directory but the most right part of the path should always be `/jellyfin`. +Note the process ID (PID) of the Jellyfin server. That is the process that has the `/jellyfin/jellyfin` command. The left part of the path might differ if you have installed Jellyfin in a different directory, but the right most part of the path should always be `/jellyfin`. Then we run the memory profiler via this command with the `{PID}` replaced by the pid we noted earlier (In this case it would be 1): @@ -52,13 +52,13 @@ Then we run the memory profiler via this command with the `{PID}` replaced by th /dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all ``` -this will then start the profiler, attach it to the jellyfin process, make a memory dump and wait. After you see the output of: +This will then start the profiler, attach it to the Jellyfin process, make a memory dump and wait. After you see the output of: ```sh [PID:{PID}] SNAPSHOT #1 READY. ``` -press `CTRL+C` or wait for 1 minute. You then get the information that the profiler ended and where the file was saved like this: +Press `CTRL+C` or wait for 1 minute. You will then get the information that the profiler ended and where the file was saved like this: ```sh Profiler disconnected. PID:{PID} @@ -71,31 +71,31 @@ You must now upload the created file, in this case `/temp/dotMemoryclt/workspace ## Docker -The docker process is essentially the same as the linux barebones, plus you need to install `ps` every time and you need to pull the result file from the container. +The docker process is essentially the same as the Linux barebones, plus you need to install `ps` every time and you need to pull the result file from the container. -First you need to figure out the ID of your jellyfin process by running: +First, you need to figure out the ID of your jellyfin process by running: ```sh docker ps ``` -this will show you all your docker containers: +This will show you all your docker containers: ```sh CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -31e5d4f30c8b jellyfin/jellyfin:10.9.9 "/jellyfin/jellyfin" 15 hours ago Up 15 hours (healthy) 8096/tcp +31e5d4f30c8b jellyfin/jellyfin:10.9.9 "/jellyfin/jellyfin" 15 hours ago Up 15 hours (healthy) 8096/tcp ``` -write down the `CONTAINER ID` and then attach your current console to that container via +Note the `CONTAINER ID` and then attach your current console to that container via ```sh docker exec -it {CONTAINERID} sh ``` -so for example `docker exec -it 31e5d4f30c8b sh`. Then follow all the steps from the Linux Barebones guide above. After that you might want to transfer the result file back to your host, assuming the same result file from the above example you can do that on your host by calling: +For example: `docker exec -it 31e5d4f30c8b sh`. Then follow all the steps from the Linux Barebones guide above. After that you might want to transfer the result file back to your host, assuming the same result file from the above example you can do that on your host by calling: ```ps docker cp {CONTAINERID}:/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw /opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw ``` -you can then proceed to upload the `/opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` result file and provide it to the jellyfin developers. +You can then proceed to upload the `/opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` result file and provide it to the jellyfin developers. From 9b389fce591636ad88fbb3bf729de8166484972f Mon Sep 17 00:00:00 2001 From: felix920506 Date: Thu, 17 Oct 2024 14:19:14 -0400 Subject: [PATCH 06/11] Link previous section in docker --- docs/general/administration/troubleshooting/memory-dumping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md index d7bcefcd5..312b8f25c 100644 --- a/docs/general/administration/troubleshooting/memory-dumping.md +++ b/docs/general/administration/troubleshooting/memory-dumping.md @@ -92,7 +92,7 @@ Note the `CONTAINER ID` and then attach your current console to that container v docker exec -it {CONTAINERID} sh ``` -For example: `docker exec -it 31e5d4f30c8b sh`. Then follow all the steps from the Linux Barebones guide above. After that you might want to transfer the result file back to your host, assuming the same result file from the above example you can do that on your host by calling: +For example: `docker exec -it 31e5d4f30c8b sh`. Then follow all the steps from the [Linux Barebones guide](/docs/general/administration/troubleshooting/memory-dumping.md#linux-barebones) above. After that you might want to transfer the result file back to your host, assuming the same result file from the above example you can do that on your host by calling: ```ps docker cp {CONTAINERID}:/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw /opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw From 26dd3ff352223f9de83d84a3cbc74292a807bbe7 Mon Sep 17 00:00:00 2001 From: felix920506 Date: Mon, 28 Oct 2024 15:21:24 -0400 Subject: [PATCH 07/11] cleanup wording with chatgpt --- .../troubleshooting/memory-dumping.md | 41 +++++++++---------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/docs/general/administration/troubleshooting/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md index 312b8f25c..991d024eb 100644 --- a/docs/general/administration/troubleshooting/memory-dumping.md +++ b/docs/general/administration/troubleshooting/memory-dumping.md @@ -3,16 +3,15 @@ uid: server-memorydumps title: Server Memory Dumps --- -# Memory Dumping of the Jellyfin server +# Memory Dumping of the Jellyfin Server -To troubleshoot a Jellyfin server that keeps allocating system memory it is necessary to dump the memory in a format that the developers then can later analyze. +To troubleshoot a Jellyfin server that continuously allocates system memory, it is necessary to create a memory dump in a format that developers can later analyze. -To dump the memory we will use the dotMemory tools from JetBrains. +We will use the dotMemory tools from JetBrains to perform the memory dump. ## Linux Barebones -First, we need to install the latest dotMemory command line tooling. -To do this, pull the nuget package and extract it to a folder named `dotMemoryClt` and then set the permissions to be executable: +First, install the latest dotMemory command line tools. To do this, download the NuGet package and extract it to a folder named `dotMemoryClt`, then set the permissions to make it executable: ```sh apt-get update -y && apt-get install -y wget && \ @@ -22,19 +21,19 @@ unzip dotMemoryclt.zip -d ./dotMemoryclt && \ chmod +x -R dotMemoryclt/* ``` -afterwards we need to figure out the process ID of the Jellyfin server: +Next, determine the process ID (PID) of the Jellyfin server: ```sh ps aux ``` -If the ps command is not available in your Linux distribution, install it with: +If the `ps` command is not available in your Linux distribution, install it with: ```sh apt-get update && apt-get install procps ``` -This will show us a number of processes like this: +This will display a list of processes similar to the following: ```cmd # ps aux @@ -44,21 +43,21 @@ root 914 0.0 0.0 2480 580 pts/0 Ss 05:33 0:00 sh root 2171 0.0 0.0 6756 2940 pts/0 R+ 12:55 0:00 ps aux ``` -Note the process ID (PID) of the Jellyfin server. That is the process that has the `/jellyfin/jellyfin` command. The left part of the path might differ if you have installed Jellyfin in a different directory, but the right most part of the path should always be `/jellyfin`. +Note the process ID (PID) of the Jellyfin server, which is associated with the `/jellyfin/jellyfin` command. The left part of the path may differ if you installed Jellyfin in a different directory, but the rightmost part should always be `/jellyfin`. -Then we run the memory profiler via this command with the `{PID}` replaced by the pid we noted earlier (In this case it would be 1): +Run the memory profiler using the following command, replacing `{PID}` with the PID you noted earlier (in this case, it would be `1`): ```sh -/dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all +/dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all ``` -This will then start the profiler, attach it to the Jellyfin process, make a memory dump and wait. After you see the output of: +This command will start the profiler, attach it to the Jellyfin process, create a memory dump, and wait. After you see the output: ```sh [PID:{PID}] SNAPSHOT #1 READY. ``` -Press `CTRL+C` or wait for 1 minute. You will then get the information that the profiler ended and where the file was saved like this: +Press `CTRL+C` or wait for one minute. You will receive a message indicating that the profiler has ended and where the file was saved: ```sh Profiler disconnected. PID:{PID} @@ -67,35 +66,35 @@ WORKSPACE SAVED file:///temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw ``` -You must now upload the created file, in this case `/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` and provide it to the jellyfin developers. +You must upload the created file, in this case `/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw`, and provide it to the Jellyfin developers. ## Docker -The docker process is essentially the same as the Linux barebones, plus you need to install `ps` every time and you need to pull the result file from the container. +The process for Docker is essentially the same as for Linux barebones, but you will need to install `ps` each time and pull the result file from the container. -First, you need to figure out the ID of your jellyfin process by running: +First, identify the ID of your Jellyfin process by running: ```sh docker ps ``` -This will show you all your docker containers: +This command will list all your Docker containers: ```sh CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 31e5d4f30c8b jellyfin/jellyfin:10.9.9 "/jellyfin/jellyfin" 15 hours ago Up 15 hours (healthy) 8096/tcp ``` -Note the `CONTAINER ID` and then attach your current console to that container via +Note the `CONTAINER ID`, then attach your console to that container with: ```sh docker exec -it {CONTAINERID} sh ``` -For example: `docker exec -it 31e5d4f30c8b sh`. Then follow all the steps from the [Linux Barebones guide](/docs/general/administration/troubleshooting/memory-dumping.md#linux-barebones) above. After that you might want to transfer the result file back to your host, assuming the same result file from the above example you can do that on your host by calling: +For example: `docker exec -it 31e5d4f30c8b sh`. Follow all the steps from the [Linux Barebones guide](/docs/general/administration/troubleshooting/memory-dumping.md#linux-barebones) above. Afterward, you may want to transfer the result file back to your host. Assuming the same result file from the previous example, you can do this on your host with: -```ps +```sh docker cp {CONTAINERID}:/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw /opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw ``` -You can then proceed to upload the `/opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` result file and provide it to the jellyfin developers. +Finally, upload the `/opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` result file and provide it to the Jellyfin developers. From 815ac7f7a65f8b71bb3ebd3a58e1399efd29817c Mon Sep 17 00:00:00 2001 From: felix920506 Date: Mon, 28 Oct 2024 15:28:25 -0400 Subject: [PATCH 08/11] manual cleanup --- .../troubleshooting/memory-dumping.md | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/docs/general/administration/troubleshooting/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md index 991d024eb..82a73e910 100644 --- a/docs/general/administration/troubleshooting/memory-dumping.md +++ b/docs/general/administration/troubleshooting/memory-dumping.md @@ -5,35 +5,36 @@ title: Server Memory Dumps # Memory Dumping of the Jellyfin Server -To troubleshoot a Jellyfin server that continuously allocates system memory, it is necessary to create a memory dump in a format that developers can later analyze. +To troubleshoot issues with Jellyfin server related to memory allocation, it is necessary to create a memory dump in a format that developers analyze. -We will use the dotMemory tools from JetBrains to perform the memory dump. +JetBrains dotMemory will be used for dumping memory in this guide. ## Linux Barebones -First, install the latest dotMemory command line tools. To do this, download the NuGet package and extract it to a folder named `dotMemoryClt`, then set the permissions to make it executable: +1. Install the latest dotMemory command line tools. To do this, download the NuGet package and extract it to a folder named `dotMemoryClt`, then set the permissions to make it executable: ```sh -apt-get update -y && apt-get install -y wget && \ -wget -O dotMemoryclt.zip https://www.nuget.org/api/v2/package/JetBrains.dotMemory.Console.linux-x64/2024.2.2 && \ -apt-get install -y unzip && \ -unzip dotMemoryclt.zip -d ./dotMemoryclt && \ -chmod +x -R dotMemoryclt/* +wget -O dotMemoryclt.zip https://www.nuget.org/api/v2/package/JetBrains.dotMemory.Console.linux-x64/2024.2.2 +unzip dotMemoryclt.zip -d ./dotMemoryclt +sudo chmod +x -R dotMemoryclt/* ``` -Next, determine the process ID (PID) of the Jellyfin server: +Next, determine the process ID (PID) of the Jellyfin server. You will need the `ps` command. If your system doesn't have this command, it can be installed using the package manager of your distribution. + +For Ubuntu: ```sh -ps aux +sudo apt update -y +sudo apt install procps ``` -If the `ps` command is not available in your Linux distribution, install it with: +Run this command to determine the PID of the Jellyfin server: ```sh -apt-get update && apt-get install procps +ps aux ``` -This will display a list of processes similar to the following: +The above command will display a list of processes similar to the following: ```cmd # ps aux @@ -43,15 +44,15 @@ root 914 0.0 0.0 2480 580 pts/0 Ss 05:33 0:00 sh root 2171 0.0 0.0 6756 2940 pts/0 R+ 12:55 0:00 ps aux ``` -Note the process ID (PID) of the Jellyfin server, which is associated with the `/jellyfin/jellyfin` command. The left part of the path may differ if you installed Jellyfin in a different directory, but the rightmost part should always be `/jellyfin`. +Note the process ID (PID) of the Jellyfin server, which is associated with the `jellyfin` command. The left part of the path may differ if you installed Jellyfin in a different directory, but the rightmost part should always be `/jellyfin`. Run the memory profiler using the following command, replacing `{PID}` with the PID you noted earlier (in this case, it would be `1`): ```sh -/dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all +sudo ./dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all ``` -This command will start the profiler, attach it to the Jellyfin process, create a memory dump, and wait. After you see the output: +This command will start the profiler, attach it to the Jellyfin process, and create a memory dump. Wait until you see the output: ```sh [PID:{PID}] SNAPSHOT #1 READY. From 056f6623ad3121c22a94f40884842f85b649a03f Mon Sep 17 00:00:00 2001 From: felix920506 Date: Mon, 28 Oct 2024 15:29:50 -0400 Subject: [PATCH 09/11] fix typo --- docs/general/administration/troubleshooting/memory-dumping.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/general/administration/troubleshooting/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md index 82a73e910..4bf52d265 100644 --- a/docs/general/administration/troubleshooting/memory-dumping.md +++ b/docs/general/administration/troubleshooting/memory-dumping.md @@ -5,7 +5,7 @@ title: Server Memory Dumps # Memory Dumping of the Jellyfin Server -To troubleshoot issues with Jellyfin server related to memory allocation, it is necessary to create a memory dump in a format that developers analyze. +To troubleshoot issues with Jellyfin server related to memory allocation, it is necessary to create a memory dump in a format that developers can analyze. JetBrains dotMemory will be used for dumping memory in this guide. From eb96862a1552ca5142cd4d0a5eb4bf5dfdd5b3f2 Mon Sep 17 00:00:00 2001 From: felix920506 Date: Mon, 28 Oct 2024 15:34:06 -0400 Subject: [PATCH 10/11] Make docker into numbered list --- .../troubleshooting/memory-dumping.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/general/administration/troubleshooting/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md index 4bf52d265..ad849b009 100644 --- a/docs/general/administration/troubleshooting/memory-dumping.md +++ b/docs/general/administration/troubleshooting/memory-dumping.md @@ -19,7 +19,7 @@ unzip dotMemoryclt.zip -d ./dotMemoryclt sudo chmod +x -R dotMemoryclt/* ``` -Next, determine the process ID (PID) of the Jellyfin server. You will need the `ps` command. If your system doesn't have this command, it can be installed using the package manager of your distribution. +2. Next, determine the process ID (PID) of the Jellyfin server. You will need the `ps` command. If your system doesn't have this command, it can be installed using the package manager of your distribution. For Ubuntu: @@ -46,7 +46,7 @@ root 2171 0.0 0.0 6756 2940 pts/0 R+ 12:55 0:00 ps aux Note the process ID (PID) of the Jellyfin server, which is associated with the `jellyfin` command. The left part of the path may differ if you installed Jellyfin in a different directory, but the rightmost part should always be `/jellyfin`. -Run the memory profiler using the following command, replacing `{PID}` with the PID you noted earlier (in this case, it would be `1`): +3. Run the memory profiler using the following command, replacing `{PID}` with the PID you noted earlier (in this case, it would be `1`): ```sh sudo ./dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all @@ -67,13 +67,13 @@ WORKSPACE SAVED file:///temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw ``` -You must upload the created file, in this case `/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw`, and provide it to the Jellyfin developers. +4. Upload the created file, in this case `/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw`, and provide it to the Jellyfin developers. ## Docker The process for Docker is essentially the same as for Linux barebones, but you will need to install `ps` each time and pull the result file from the container. -First, identify the ID of your Jellyfin process by running: +1. Identify the ID of your Jellyfin process by running: ```sh docker ps @@ -86,13 +86,19 @@ CONTAINER ID IMAGE COMM 31e5d4f30c8b jellyfin/jellyfin:10.9.9 "/jellyfin/jellyfin" 15 hours ago Up 15 hours (healthy) 8096/tcp ``` -Note the `CONTAINER ID`, then attach your console to that container with: +Note the `CONTAINER ID` + +2. Attach your console to the Jellyfin container with the following command: ```sh docker exec -it {CONTAINERID} sh ``` -For example: `docker exec -it 31e5d4f30c8b sh`. Follow all the steps from the [Linux Barebones guide](/docs/general/administration/troubleshooting/memory-dumping.md#linux-barebones) above. Afterward, you may want to transfer the result file back to your host. Assuming the same result file from the previous example, you can do this on your host with: +Replace `{CONTAINERID}` with the `CONTAINER ID` you noted down previously. For example: `docker exec -it 31e5d4f30c8b sh`. + +3. After attaching a console to the container, follow all the steps from the [Linux Barebones guide](/docs/general/administration/troubleshooting/memory-dumping.md#linux-barebones) above. + +4. Transfer the result file back to your host. Assuming the same result file from the previous example, you can do this on your host with: ```sh docker cp {CONTAINERID}:/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw /opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw From c4323f319f192320f698984ea08071ab486b41b1 Mon Sep 17 00:00:00 2001 From: felix920506 Date: Mon, 28 Oct 2024 16:04:30 -0400 Subject: [PATCH 11/11] fix spacing --- .../troubleshooting/memory-dumping.md | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/docs/general/administration/troubleshooting/memory-dumping.md b/docs/general/administration/troubleshooting/memory-dumping.md index ad849b009..81ed8d82a 100644 --- a/docs/general/administration/troubleshooting/memory-dumping.md +++ b/docs/general/administration/troubleshooting/memory-dumping.md @@ -13,59 +13,59 @@ JetBrains dotMemory will be used for dumping memory in this guide. 1. Install the latest dotMemory command line tools. To do this, download the NuGet package and extract it to a folder named `dotMemoryClt`, then set the permissions to make it executable: -```sh -wget -O dotMemoryclt.zip https://www.nuget.org/api/v2/package/JetBrains.dotMemory.Console.linux-x64/2024.2.2 -unzip dotMemoryclt.zip -d ./dotMemoryclt -sudo chmod +x -R dotMemoryclt/* -``` + ```sh + wget -O dotMemoryclt.zip https://www.nuget.org/api/v2/package/JetBrains.dotMemory.Console.linux-x64/2024.2.2 + unzip dotMemoryclt.zip -d ./dotMemoryclt + sudo chmod +x -R dotMemoryclt/* + ``` 2. Next, determine the process ID (PID) of the Jellyfin server. You will need the `ps` command. If your system doesn't have this command, it can be installed using the package manager of your distribution. -For Ubuntu: + For Ubuntu: -```sh -sudo apt update -y -sudo apt install procps -``` + ```sh + sudo apt update -y + sudo apt install procps + ``` -Run this command to determine the PID of the Jellyfin server: + Run this command to determine the PID of the Jellyfin server: -```sh -ps aux -``` + ```sh + ps aux + ``` -The above command will display a list of processes similar to the following: + The above command will display a list of processes similar to the following: -```cmd -# ps aux -USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND -root 1 1.8 7.4 276905428 2304952 ? Ssl Sep04 17:23 /jellyfin/jellyfin -root 914 0.0 0.0 2480 580 pts/0 Ss 05:33 0:00 sh -root 2171 0.0 0.0 6756 2940 pts/0 R+ 12:55 0:00 ps aux -``` + ```cmd + # ps aux + USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND + root 1 1.8 7.4 276905428 2304952 ? Ssl Sep04 17:23 /jellyfin/jellyfin + root 914 0.0 0.0 2480 580 pts/0 Ss 05:33 0:00 sh + root 2171 0.0 0.0 6756 2940 pts/0 R+ 12:55 0:00 ps aux + ``` -Note the process ID (PID) of the Jellyfin server, which is associated with the `jellyfin` command. The left part of the path may differ if you installed Jellyfin in a different directory, but the rightmost part should always be `/jellyfin`. + Note the process ID (PID) of the Jellyfin server, which is associated with the `jellyfin` command. The left part of the path may differ if you installed Jellyfin in a different directory, but the rightmost part should always be `/jellyfin`. 3. Run the memory profiler using the following command, replacing `{PID}` with the PID you noted earlier (in this case, it would be `1`): -```sh -sudo ./dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all -``` + ```sh + sudo ./dotMemoryclt/tools/dotmemory attach --temp-dir=/temp/dotMemoryclt/tmp --timeout=1m --trigger-on-activation -m=1 --save-to-dir=/temp/dotMemoryclt/workspaces --log-file=/temp/dotMemoryclt/tmp/log.txt {PID} --all + ``` -This command will start the profiler, attach it to the Jellyfin process, and create a memory dump. Wait until you see the output: + This command will start the profiler, attach it to the Jellyfin process, and create a memory dump. Wait until you see the output: -```sh -[PID:{PID}] SNAPSHOT #1 READY. -``` + ```sh + [PID:{PID}] SNAPSHOT #1 READY. + ``` -Press `CTRL+C` or wait for one minute. You will receive a message indicating that the profiler has ended and where the file was saved: + Press `CTRL+C` or wait for one minute. You will receive a message indicating that the profiler has ended and where the file was saved: -```sh -Profiler disconnected. PID:{PID} -Saving workspace... -WORKSPACE SAVED -file:///temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw -``` + ```sh + Profiler disconnected. PID:{PID} + Saving workspace... + WORKSPACE SAVED + file:///temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw + ``` 4. Upload the created file, in this case `/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw`, and provide it to the Jellyfin developers. @@ -75,33 +75,33 @@ The process for Docker is essentially the same as for Linux barebones, but you w 1. Identify the ID of your Jellyfin process by running: -```sh -docker ps -``` + ```sh + docker ps + ``` -This command will list all your Docker containers: + This command will list all your Docker containers: -```sh -CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -31e5d4f30c8b jellyfin/jellyfin:10.9.9 "/jellyfin/jellyfin" 15 hours ago Up 15 hours (healthy) 8096/tcp -``` + ```sh + CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES + 31e5d4f30c8b jellyfin/jellyfin:10.9.9 "/jellyfin/jellyfin" 15 hours ago Up 15 hours (healthy) 8096/tcp + ``` -Note the `CONTAINER ID` + Note the `CONTAINER ID` 2. Attach your console to the Jellyfin container with the following command: -```sh -docker exec -it {CONTAINERID} sh -``` + ```sh + docker exec -it {CONTAINERID} sh + ``` -Replace `{CONTAINERID}` with the `CONTAINER ID` you noted down previously. For example: `docker exec -it 31e5d4f30c8b sh`. + Replace `{CONTAINERID}` with the `CONTAINER ID` you noted down previously. For example: `docker exec -it 31e5d4f30c8b sh`. 3. After attaching a console to the container, follow all the steps from the [Linux Barebones guide](/docs/general/administration/troubleshooting/memory-dumping.md#linux-barebones) above. 4. Transfer the result file back to your host. Assuming the same result file from the previous example, you can do this on your host with: -```sh -docker cp {CONTAINERID}:/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw /opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw -``` + ```sh + docker cp {CONTAINERID}:/temp/dotMemoryclt/workspaces/[1]-jellyfin.2024-09-05T06-27-14.471.dmw /opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw + ``` -Finally, upload the `/opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` result file and provide it to the Jellyfin developers. +5. Upload the `/opt/[1]-jellyfin.2024-09-05T06-27-14.471.dmw` result file and provide it to the Jellyfin developers.