I try to load a large file (20gb) and load it into a matrix. However I get a bad_alloc error when it tries to load the file in the matrix. My code is working on Mac but doesn't on Linux.
Here is my code:
std::ifstream ifs(filename, std::ifstream::binary);
loadModel(ifs);
void loadModel(std::istream& in) {
input_ = std::make_shared<Matrix>();
input_->load(in); // bad_alloc
}