![如何在 MongoDB 上执行核心转储](https://linux22.com/image/681714/%E5%A6%82%E4%BD%95%E5%9C%A8%20MongoDB%20%E4%B8%8A%E6%89%A7%E8%A1%8C%E6%A0%B8%E5%BF%83%E8%BD%AC%E5%82%A8.png)
我正在调查 MongoDB 中潜在的内存泄漏,昨晚我遇到了一个问题,即正在使用的常驻内存意外攀升至 +10GB。
我正在尝试执行核心转储来检查内存的内容,但是遇到了问题。
我尝试使用程序在这里找到,使用kill -SIGQUIT 9999
,然而这似乎并没有产生实际的核心转储mongod
,相反,我唯一能找到的是我的日志文件末尾的几行无用的行。
2016-04-27T14:28:01.413+0000 F - [initandlisten] Got signal: 3 (Quit).
0x1310252 0x130f189 0x130f992 0x349f40f500 0x349f0e0d03 0x12b4fc4 0x977f26 0x97a9bd 0x349f01ecdd 0x974881
----- BEGIN BACKTRACE -----
{"backtrace":[{"b":"400000","o":"F10252","s":"_ZN5mongo15printStackTraceERSo"},{"b":"400000","o":"F0F189"},{"b":"400000","o":"F0F992"},{"b":"349F400000","o":"F500"},{"b":"349F000000","o":"E0D03","s":"__select"},{"b":"400000","o":"EB4FC4","s":"_ZN5mongo8Listener13initAndListenEv"},{"b":"400000","o":"577F26","s":"_ZN5mongo13initAndListenEi"},{"b":"400000","o":"57A9BD","s":"main"},{"b":"349F000000","o":"1ECDD","s":"__libc_start_main"},{"b":"400000","o":"574881"}],"processInfo":{ "mongodbVersion" : "3.2.4", "gitVersion" : "e2ee9ffcf9f5a94fad76802e28cc978718bb7a30", "compiledModules" : [], "uname" : { "sysname" : "Linux", "release" : "2.6.39-300.17.2.el6uek.x86_64", "version" : "#1 SMP Wed Nov 7 17:48:36 PST 2012", "machine" : "x86_64" }, "somap" : [ { "elfType" : 2, "b" : "400000", "buildId" : "5FD49352786BCEAEC14C2C99263D7EDCC9F681FD" }, { "b" : "7FFF433DF000", "elfType" : 3, "buildId" : "1E333CA5361BDB0097E9F47A6280B1AB5EEF4F0A" }, { "path" : "/usr/lib64/libssl.so.10", "elfType" : 3, "buildId" : "145F7FE3952D398F1580F65D309F7B84C170C46B" }, { "path" : "/usr/lib64/libcrypto.so.10", "elfType" : 3, "buildId" : "04B2B7E614BF9844F5191F8A81E15B0F60A1EF3A" }, { "path" : "/lib64/librt.so.1", "elfType" : 3, "buildId" : "A34F8F7191C98A2AAEC9150CD504EE6E3E1BA7CD" }, { "path" : "/lib64/libdl.so.2", "elfType" : 3, "buildId" : "15B0822C819020F18BBF0E0C0286373155E03BE2" }, { "path" : "/usr/lib64/libstdc++.so.6", "elfType" : 3, "buildId" : "1A4BC78E7DA0FA025262D516D00E04AFD1B0F429" }, { "path" : "/lib64/libm.so.6", "elfType" : 3, "buildId" : "4506D67E9AC196C2A4C51CF9804C469B5465AA89" }, { "path" : "/lib64/libgcc_s.so.1", "elfType" : 3, "buildId" : "CE152B8676517F23E7F54AD6408330979BE41443" }, { "path" : "/lib64/libpthread.so.0", "elfType" : 3, "buildId" : "7A688BCD17DD94352FD083FB9A64DCAF6296428E" }, { "path" : "/lib64/libc.so.6", "elfType" : 3, "buildId" : "9482B5DFEC6960CE8D5D90CECF6C77DC18A11272" }, { "path" : "/lib64/ld-linux-x86-64.so.2", "elfType" : 3, "buildId" : "CBC6E7266FCF291CEE239F38D1DD7B59D82AADBD" }, { "path" : "/lib64/libgssapi_krb5.so.2", "elfType" : 3, "buildId" : "5A849E6F82D34BFDF59D7B3ACD00BE9A7E24B6F1" }, { "path" : "/lib64/libkrb5.so.3", "elfType" : 3, "buildId" : "C2F73DA1AF5D07B0B72F82ED3690456C4EDF3E0E" }, { "path" : "/lib64/libcom_err.so.2", "elfType" : 3, "buildId" : "6A8EE2F10B2BB3A361B366DB93A0884E70A4D03B" }, { "path" : "/lib64/libk5crypto.so.3", "elfType" : 3, "buildId" : "2C7D5C2761C37E2B0B9F2719A8AF6ADA48D4895C" }, { "path" : "/lib64/libz.so.1", "elfType" : 3, "buildId" : "209A7EBEAB54483FED76E2A984B4AEAE29C66D69" }, { "path" : "/lib64/libkrb5support.so.0", "elfType" : 3, "buildId" : "DE4E1481ECA0ADF2F15A4D830CF2C43A29350087" }, { "path" : "/lib64/libkeyutils.so.1", "elfType" : 3, "buildId" : "8A8734DC37305D8CC2EF8F8C3E5EA03171DB07EC" }, { "path" : "/lib64/libresolv.so.2", "elfType" : 3, "buildId" : "E48B7A85C3EE7A22CBCAC817C407458CC0A9D47F" }, { "path" : "/lib64/libselinux.so.1", "elfType" : 3, "buildId" : "A287DC6B86A9823038F057105CE64671E0B392EC" } ] }}
mongod(_ZN5mongo15printStackTraceERSo+0x32) [0x1310252]
mongod(+0xF0F189) [0x130f189]
mongod(+0xF0F992) [0x130f992]
libpthread.so.0(+0xF500) [0x349f40f500]
libc.so.6(__select+0x33) [0x349f0e0d03]
mongod(_ZN5mongo8Listener13initAndListenEv+0x4B4) [0x12b4fc4]
mongod(_ZN5mongo13initAndListenEi+0x1316) [0x977f26]
mongod(main+0x15D) [0x97a9bd]
libc.so.6(__libc_start_main+0xFD) [0x349f01ecdd]
mongod(+0x574881) [0x974881]
----- END BACKTRACE -----
知道如何在这里获取核心转储吗?