• 2024-11-07golang oom监控实现
    packagemainimport( "bytes" "fmt" "io/ioutil" "os" "golang.org/x/sys/unix")funcmain(){ varevents[128]unix.EpollEvent varbuf[8]byte //unix.EFD_CLOEXEC确保在exec调用时关闭efd,它可以防止文件描述符在不需