Why my program does not take more than 2 GB RAM on

2019-09-10 03:56发布

问题:

I am trying to train a Dlib's train_shape_predictor_ex.cpp with Halen dataset. I compiled the code with Visual Studio in release mode for 64-bit plateform as console application.

When I run the train_shape_predictor_ex.exe in command prompt, the executed process started and I saw in Task Manager that memory consumption by this process was increasing but it was stopped till around 1.9 GB and gave a Run-time Exception: bad allocation. It is unable to take more RAM than around around 1.9 GB RAM even My system is 64 GB RAM

Can anybody help me getting solve this problem? Thanks in advance !

回答1:

To build C++ Application which can consume Physical memory than normal 32-Bit application(means 2GB), It is needed to built the application in 64-bit mode.

  • Enable the /LARGEADDRESSAWARE flag to true
  • Build application for 65-bit target CPU.