Skip to content

Java service tool

Since build 5.2.2180, the Java service command line tool is available. The tool executes some Java service and diagnostics commands like garbage collection for WCS Java process.

Garbage collection

/usr/local/FlashphonerWebCallServer/tools/jcmd.sh gc

This is the command to launch garbage collection. It may be useful if a lot of Java heap memory is occupied while server is not loaded.

Warning

This may affect all the streaming functions. Use with care.

Thread dump collection

/usr/local/FlashphonerWebCallServer/tools/jcmd.sh jstack --output /tmp/jstack.dump

The command collects thread stack dump to the file.

Warning

When WCS is running on Java 8, the folder should be writable to others group

By default, the stack dump is collected to a file in /usr/local/FlashphonerWebCallServer/report/ folder, for example

/usr/local/FlashphonerWebCallServer/report/report-2025-03-07-15-58-28/501582.jstack

Where:

  • report-2025-03-07-15-58-28 - subfolder with current date and time
  • 501582 - WCS Java main process pid

Heap dump collection

/usr/local/FlashphonerWebCallServer/tools/jcmd.sh dump --output /tmp/heap.dump

The command collects Java heap dump to the file.

Warning

  1. When WCS is running on Java 8, the folder should be writable to others group
  2. This may affect all the streaming functions. Use with care.

By default, the stack dump is collected to a file in /usr/local/FlashphonerWebCallServer/report/ folder, for example

/usr/local/FlashphonerWebCallServer/report/report-2025-03-07-16-06-00/501582.hprof

Where:

  • report-2025-03-07-16-06-00 - subfolder with current date and time
  • 501582 - WCS Java main process pid

Flight recording

/usr/local/FlashphonerWebCallServer/tools/jcmd.sh jfr --output /tmp/heap.dump --duration 120s

The command starts Java flight recording to the file. Flight recording stops after the duration set.

Warning

  1. When WCS is running on Java 8, the folder should be writable to others group
  2. The server CPU load may increase when flight recording is started

By default, the flight recording is collected during 60 seconds to a file in /usr/local/FlashphonerWebCallServer/report/ folder, for example

/usr/local/FlashphonerWebCallServer/report/report-2025-03-07-16-11-49/501582.jfr

Where:

  • report-2025-03-07-16-11-49 - subfolder with current date and time
  • 501582 - WCS Java main process pid