Under linux, a CPP service, if the CPU and memory is very high, how should it be checked?

Under

RT,linux, how to troubleshoot a CPP service with high CPU and memory? Trouble a little bit and hope to give a more detailed answer. At present, all I can think of is gdb, but I"m not quite sure how to get gdb.

Mar.11,2021

are you under Linux? Linux before I used a tool Valgrind, can do memory optimization, error checking, etc., it is very easy to use, put your debug version of the program behind the implementation of valgrind on it, he will dynamically collect the information executed by the program for optimization and troubleshooting, very helpful. The disadvantage is that the execution of your program becomes slower.

Menu