Friday, October 30, 2020

Check the open files limit and current for a process

> for p in $(pidof java); do printf "$p: "; ls -l /proc/$p/fd |wc -l; done
54055: 93
54008: 9


> for p in $(pidof java); do printf "$p: "; cat /proc/$p/limits |grep open; done
54055: Max open files            65536                65536                files
54008: Max open files            65536                65536                files

Friday, October 9, 2020

Compiler flags

want to find compiler flags supported by your CPU?

gcc -v -E -x c /dev/null -o /dev/null -march=native 2>&1 | grep /cc1