Lab - Configuration File - out of memory

I received this error when I tried to run the mongod config file:

vagrant@m103:~$ mongod -f /data/mongod.conf
tcmalloc: large alloc 9223372036854775808 bytes == (nil) @
2019-09-14T16:08:02.706+0000 F - [main] out of memory.

0x7f7f5746c731 0x7f7f5746bd64 0x7f7f5755ae4b 0x7f7f575fd874 0x7f7f5738deb3 0x7f7f5738360f 0x7f7f5738af11 0x7f7f55ac6ce1 0x7f7f55ab70c3 0x7f7f57421074 0x7f7f57421752 0x7f7f55ac1dd7 0x7f7f55a47709 0x7f7f51e19f45 0x7f7f55ab1f5f
----- BEGIN BACKTRACE -----
{β€œbacktrace”:[{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ23F7731”,β€œs”:"_ZN5mongo15printStackTraceERSo"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ23F6D64”,β€œs”:"_ZN5mongo29reportOutOfMemoryErrorAndExitEv"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ24E5E4B”},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ2588874”,β€œs”:"_Znam"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ2318EB3”,β€œs”:"_ZNSt6vectorIcSaIcEE17_M_default_appendEm"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ230E60F”,β€œs”:β€œZN5mongo17optionenvironment13OptionsParser14readConfigFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS7”},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ2315F11”,β€œs”:"_ZN5mongo17optionenvironment13OptionsParser3runERKNS0_13OptionSectionERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EERKSt3mapISB_SB_St4lessISB_ESaISt4pairIKSB_SB_EEEPNS0_11EnvironmentE"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œA51CE1”,β€œs”:"_ZN5mongo17optionenvironment46_mongoInitializerFunction_StartupOptions_ParseEPNS_18InitializerContextE"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œA420C3”,β€œs”:β€œZNSt17_Function_handlerIFN5mongo6StatusEPNS0_18InitializerContextEEPS4_E9_M_invokeERKSt9_Any_dataOS3”},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ23AC074”,β€œs”:"_ZNK5mongo11Initializer7executeERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EERKSt3mapIS7_S7_St4lessIS7_ESaISt4pairIKS7_S7_EEE"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ23AC752”,β€œs”:β€œZN5mongo21runGlobalInitializersEiPKPKcS3”},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œA4CDD7”,β€œs”:β€œZN5mongo11mongoDbMainEiPPcS1”},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œ9D2709”,β€œs”:β€œmain”},{β€œb”:β€œ7F7F51DF8000”,β€œo”:β€œ21F45”,β€œs”:"__libc_start_main"},{β€œb”:β€œ7F7F55075000”,β€œo”:β€œA3CF5F”}]}
mongod(_ZN5mongo15printStackTraceERSo+0x41) [0x7f7f5746c731]
mongod(_ZN5mongo29reportOutOfMemoryErrorAndExitEv+0x84) [0x7f7f5746bd64]
mongod(+0x24E5E4B) [0x7f7f5755ae4b]
mongod(_Znam+0x224) [0x7f7f575fd874]
mongod(_ZNSt6vectorIcSaIcEE17_M_default_appendEm+0x83) [0x7f7f5738deb3]
mongod(ZN5mongo17optionenvironment13OptionsParser14readConfigFileERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPS7+0x25F) [0x7f7f5738360f]
mongod(_ZN5mongo17optionenvironment13OptionsParser3runERKNS0_13OptionSectionERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaISB_EERKSt3mapISB_SB_St4lessISB_ESaISt4pairIKSB_SB_EEEPNS0_11EnvironmentE+0x1581) [0x7f7f5738af11]
mongod(_ZN5mongo17optionenvironment46_mongoInitializerFunction_StartupOptions_ParseEPNS_18InitializerContextE+0x51) [0x7f7f55ac6ce1]
mongod(ZNSt17_Function_handlerIFN5mongo6StatusEPNS0_18InitializerContextEEPS4_E9_M_invokeERKSt9_Any_dataOS3+0x23) [0x7f7f55ab70c3]
mongod(_ZNK5mongo11Initializer7executeERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EERKSt3mapIS7_S7_St4lessIS7_ESaISt4pairIKS7_S7_EEE+0x1E4) [0x7f7f57421074]
mongod(ZN5mongo21runGlobalInitializersEiPKPKcS3+0x352) [0x7f7f57421752]
mongod(ZN5mongo11mongoDbMainEiPPcS1+0xA7) [0x7f7f55ac1dd7]
mongod(main+0x9) [0x7f7f55a47709]
libc.so.6(__libc_start_main+0xF5) [0x7f7f51e19f45]
mongod(+0xA3CF5F) [0x7f7f55ab1f5f]
----- END BACKTRACE -----

My config file context is like this:
storage:
dbPath:/data/db/
systemLog:
path:/data/log/mongod.log
destination:file
net:
bindIp:192.168.103.100,localhost
port:27000
security:
keyFile:/data/keyfile
authorization:enabled
processManagement:
fork:true

Could you have any suggestions that may help, please let me know.
Thanks in advance!

Does your configfile exist at the path mentioned?
Please check ls -lrt /data/mongod.conf
Usually this error occurs if you pass a directory instead of file to mongod

3 Likes

Yes, you are right. That was a directory. I used β€œtouch” to create that conf file instead and it worked fine. Many thanks!