Article From:https://www.cnblogs.com/wongdu2014/p/9123238.html

       The program often appears OOM error, and then the keyword “go pprof” search the article < Go program performance analysis pprof> the second step of the article says the program will generate the profile file after running the program, but after the compilation runs, the generated profile file is found to be largeThe small has been 0, and then the keyword “go pprof profile is empty” search the article < Golang pprof heap profile is empty> this article says that the environment changes before running the program.The quantity GODEBUG= “memprofilerate=1”, but it seems to be useless.

       Then the previous keyword “go pprof” search the article < use golang’s pprof package to perform performance analysis > this article points out that “using pprof in the code, three cases in practical use”, because the program is not run once.Exit, but as a service, so “need to open a goroutine to open port listener”, and then refer to the article < go memory leaks case> pay attention to the second step “(2) memory profile” description “using –alloC_space can display all the assigned objects “, when using the web command, the wrong” Cannot find dot, have you installed Graphviz? “And then the keyword” CentOS GraphviZ “search the article < Linux Centos7 install configuration drawing tool Graphviz> refer to this article to install Graphviz but Web command will still be false” xdg-open: no method availabLe for opening’/tmp/pprof-964683453/pprof001.svg'”, I don’t know why you have to copy the temporary SVG files to windows with ie, and don’t understand why the curl is behind.When -T copies it, it says that the file does not exist.

       If there is no `import “net/http/pprof” in the program code, then “go tool tool pprof http://localhost:6060/debug/pprof/heap” will report “s”.Erver response: 404 Not Found “. Keyword “inuse_space” search article < golang memory analysis / dynamic tracking >

Leave a Reply

Your email address will not be published. Required fields are marked *