Tue Dec 31 10:14:31.693 [conn9654] end connection 1.2.3.4:40328 (1 connection now open) Tue Dec 31 10:14:31.694 [initandlisten] connection accepted from 1.2.3.4:40338 #9655 (2 connections now open) Tue Dec 31 10:14:42.567 [rsBackgroundSync] replSet syncing to: 1.2.3.4:27017 Tue Dec 31 10:14:50.204 [journal] old journal file will be removed: /path/to/mongodb/journal/j._58 Tue Dec 31 10:14:50.243 [journal] old journal file will be removed: /path/to/mongodb/journal/j._59 Tue Dec 31 10:15:01.718 [conn9655] end connection 1.2.3.4:40338 (1 connection now open) Tue Dec 31 10:15:01.718 [initandlisten] connection accepted from 1.2.3.4:40354 #9656 (2 connections now open) Tue Dec 31 10:15:19.196 [repl writer worker 2] info: indexing in foreground on this replica; was a background index build on the primary Tue Dec 31 10:15:19.196 [repl writer worker 2] build index foo.foo { _pm: 1.0 } Tue Dec 31 10:15:29.003 [repl writer worker 2] Index: (1/3) External Sort Progress: 30000/18446744073693998983 0% Tue Dec 31 10:15:31.738 [conn9656] end connection 1.2.3.4:40354 (1 connection now open) Tue Dec 31 10:15:31.739 [initandlisten] connection accepted from 1.2.3.4:40363 #9657 (2 connections now open) Tue Dec 31 10:15:39.080 [repl writer worker 2] Index: (1/3) External Sort Progress: 66300/18446744073693998983 0% Tue Dec 31 10:15:49.019 [repl writer worker 2] Index: (1/3) External Sort Progress: 74800/18446744073693998983 0% tcmalloc: large alloc 18446744073336291328 bytes == (nil) @ Tue Dec 31 10:15:51.992 out of memory, printing stack and exiting: 0xde05e1 0x6cf37e 0x12129fd 0x9416b7 0x9dd707 0x9e1adf 0x9e2451 0xac0605 0xac4e12 0xa6d9cf 0xc29713 0xc28e58 0xdadf21 0xe28e69 0x7fb3baf4cb50 0x7fb3ba2efa7d /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde05e1] /usr/bin/mongod(_ZN5mongo14my_new_handlerEv+0x3e) [0x6cf37e] /usr/bin/mongod(_Znam+0x6d) [0x12129fd] /usr/bin/mongod(_ZN5mongo21BSONObjExternalSorter3addERKNS_7BSONObjERKNS_7DiskLocEb+0x247) [0x9416b7] /usr/bin/mongod(_ZN5mongo17addKeysToPhaseOneEPKcRKNS_12IndexDetailsERKNS_7BSONObjEPNS_12SortPhaseOneElPNS_13ProgressMeterEb+0x297) [0x9dd707] /usr/bin/mongod(_ZN5mongo14fastBuildIndexEPKcPNS_16NamespaceDetailsERNS_12IndexDetailsEb+0x103f) [0x9e1adf] /usr/bin/mongod(_ZN5mongo12buildAnIndexERKSsPNS_16NamespaceDetailsERNS_12IndexDetailsEbb+0x1b1) [0x9e2451] /usr/bin/mongod(_ZN5mongo16insert_makeIndexEPNS_16NamespaceDetailsERKSsRKNS_7DiskLocEb+0x2b5) [0xac0605] /usr/bin/mongod(_ZN5mongo11DataFileMgr6insertEPKcPKvibbbPb+0x7d2) [0xac4e12] /usr/bin/mongod(_ZN5mongo21applyOperation_inlockERKNS_7BSONObjEbb+0x82f) [0xa6d9cf] /usr/bin/mongod(_ZN5mongo7replset8SyncTail9syncApplyERKNS_7BSONObjEb+0x713) [0xc29713] /usr/bin/mongod(_ZN5mongo7replset14multiSyncApplyERKSt6vectorINS_7BSONObjESaIS2_EEPNS0_8SyncTailE+0x48) [0xc28e58] /usr/bin/mongod(_ZN5mongo10threadpool6Worker4loopEv+0x281) [0xdadf21] /usr/bin/mongod() [0xe28e69] /lib/x86_64-linux-gnu/libpthread.so.0(+0x6b50) [0x7fb3baf4cb50] /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fb3ba2efa7d]