我在我的程序中成功使用mtrace()
,但它只创建了一个 16MB 的不可读文件,我在这里读到创建一个我应该使用的可读文件:
mtrace ./myexe log
问题是我有一个需要一些参数的服务器,我也必须在它上面运行一个应用程序,我尝试运行这个:
mtrace "./Server args" log
但相反,如果打开服务器并等待应用程序,它只会输出一个未释放内存的列表。
所以我的问题是如何mtrace
正确使用服务器?
编辑:
用不可读的文件运行 mtrace 给我这个:
mtrace "./Server args" log
很多这样的行:
- 0x0000000003941d40 Free 224404 was never alloc'd 0x2384d8b
和这个:
Memory not freed:
-----------------
Address Size Caller
0x00000000039600f0 0x48 at 0x238766c
0x00000000039739e0 0x38 at 0x37f0c0cbad
0x00007fc398000960 0x75 at 0x7fc3f3f0b2fd
0x00007fc3980009e0 0x30 at 0x7fc3f3f0b2fd
0x00007fc3c0001240 0x26 at 0x7fc3f3f0b2fd
0x00007fc3c00012a0 0x27 at 0x7fc3f3f0b2fd
0x00007fc3c0001ee0 0x29 at 0x7fc3f3f0b2fd
0x00007fc3c0001f20 0x2a at 0x7fc3f3f0b2fd
0x00007fc3c0001f90 0x2a at 0x7fc3f3f0b2fd
0x00007fc3c0001fd0 0x22 at 0x7fc3f3f0b2fd
0x00007fc3c0002030 0x2a at 0x7fc3f3f0b2fd
0x00007fc3c00026c0 0x29 at 0x7fc3f3f0b2fd
0x00007fc3c0002700 0x22 at 0x7fc3f3f0b2fd
0x00007fc3c0002730 0x29 at 0x7fc3f3f0b2fd
0x00007fc3c00032d0 0x26 at 0x7fc3f3f0b2fd
0x00007fc3c00034d0 0x27 at 0x7fc3f3f0b2fd
0x00007fc3c00035b0 0x22 at 0x7fc3f3f0b2fd
0x00007fc3c00035e0 0x29 at 0x7fc3f3f0b2fd
0x00007fc3c00082b0 0x9 at 0x37f1081182
0x00007fc3c00084b0 0x28 at 0x7fc3f3f0b2fd
0x00007fc3c000a2f0 0xb at 0x37f1081182
0x00007fc3c000a650 0x26 at 0x7fc3f3f0b2fd
0x00007fc3c000ac10 0x1e at 0x7fc3f3f0b2fd
0x00007fc3c000af90 0xc at 0x37f1081182
0x00007fc3c000b360 0x29 at 0x7fc3f3f0b2fd
0x00007fc3c000b870 0x38 at 0x7fc3f3f0b2fd
0x00007fc3c000ede0 0xc at 0x37f1081182
0x00007fc3c00118a0 0x22 at 0x7fc3f3f0b2fd
0x00007fc3c0011f30 0x2c at 0x7fc3f3f0b2fd
0x00007fc3c0011fd0 0x1e at 0x7fc3f3f0b2fd
0x00007fc3c0012040 0x2a at 0x7fc3f3f0b2fd
0x00007fc3c0012c30 0x40 at 0x7fc3f3f0b2fd
0x00007fc3c0014700 0xb at 0x37f1081182
0x00007fc3c0014f10 0xb at 0x37f1081182
0x00007fc3c0014fa0 0xb at 0x37f1081182
0x00007fc3c00151d0 0x88 at 0x7fc3f7cc05c9
0x00007fc3c001d4b0 0x88 at 0x7fc3f7cc05c9
0x00007fc3c0024a00 0xb at 0x37f1081182
0x00007fc3c003e960 0x40 at 0x7fc3f3f0b2fd
0x00007fc3c003edb0 0x88 at 0x7fc3f3f0b2fd
0x00007fc3c003ee40 0x170 at 0x37f0c118a3
0x00007fc3c003efc0 0x88 at 0x7fc3f3f0b2fd
0x00007fc3c003f050 0x170 at 0x37f0c118a3
0x00007fc3c003f1d0 0x88 at 0x7fc3f3f0b2fd
0x00007fc3c003f260 0x170 at 0x37f0c118a3
0x00007fc3c003f3e0 0x88 at 0x7fc3f3f0b2fd
0x00007fc3c003f470 0x170 at 0x37f0c118a3
0x00007fc3c003f5f0 0x88 at 0x7fc3f3f0b2fd
0x00007fc3c003f680 0x170 at 0x37f0c118a3
0x00007fc3c003f800 0x88 at 0x7fc3f3f0b2fd
0x00007fc3c003f890 0x170 at 0x37f0c118a3
0x00007fc3c0040890 0 at 0x7fc3efa7ee9d
0x00007fc3c00408b0 0x8 at 0x7fc3efa7ee9d
0x00007fc3c0040fc0 0x3f0 at 0x7fc3f3f0b2fd