Can't compile it on small VPS with 1GB. But it compiles well with 6GB and 8GB. Is it really nesessary to have at least 6GB of RAM for compiling TDLib?
C++ compilers need enormous amount of resources for compilation nowadays. We have done many source code optimizations to decrease memory consumption and compilation time, but not so much depends on us here. The memory consumption grows very fast even on very simple code.
For now it should be enough 1.5-2 GB to build TDLib using clang or MSVC and 3.5-4 GB is needed for g++.
Between, what compiler/CMake version you are using?
@levlam I use g++, will try clang.
On my server with 4GB of RAM it suspended on compiling ContactsManager.cpp file. I waited for many hours, but with no success.
Then I have deployed VM with 6GB and watched RAM use. And confirmed that when ContactsManager.cpp compiling it uses nearly 4270 MB on Debian 9 with g++ 6.3.
I didn't guess that it so gluttonous process!
You need to try ninja 馃槈
https://github.com/tdlib/td/issues/6
Seriously, try setting limits in Linux.
P.S.
The main thing is not to break anything
TDLib 1.4.0 includes a lot of compilation memory usage optimizations and a new script SplitSource.php, which can be used to split some source code files before building the library to reduce maximum RAM usage per file at the expense of increased build time. In our tests clang 6.0 with libc++ required less than 500 MB of RAM per file and GCC 4.9/6.3 used less than 1 GB of RAM per file.