Friday, June 26, 2020

Some usages of jstat

-gcutil

$ jstat -gcutil


This command shows utilization percentage of memory spaces of a java process.

S0: Survivor space 0
S1: Survivor space 1
E: Eden space
O: Old-gen space

GC activities

YGC: Young GC count
YGCT: Time spent by Young GC 
FGC: Full GC count
FGCT: Time spent by Full GC


-gc

$ jstat -gc

Find the current vm heap size by sum value under S0C, S01, EC, OC


More at https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jstat.html

[Linux] Visualize parent - child process relationship

$ ps -axf -o pid,ppid,tty,stat,cmd

Credit: Orphan vs Zombie vs Daemon processes

Thursday, July 25, 2019

Compress a file before scp from remote server to local


ssh user@host "tar -zcvf - -C /path/to/dir filename" | tar -zxvf -

Note: only use when it's much faster to transfer a compressed file to your machine than transferring the original one.

Credits:
https://superuser.com/a/1354868
https://stackoverflow.com/a/3035446/1032449

Wednesday, August 22, 2018

Useful commands for observe running JVM process

$ jcmd

List running processes

$ jinfo 

Get details of a process

$ jps -lvm

List running processes with params

Collectd PostgreSQL Plugin

I couldn't find this link when searching with google https://www.collectd.org/documentation/manpages/collectd.conf.html#plugin-postgresq...