[LLVMdev] Making LLVM safer in out-of-memory situations

James Courtier-Dutton james.dutton at gmail.com
Thu Jan 9 07:50:12 PST 2014


On 12 December 2013 12:25, Gasiunas, Vaidas <vaidas.gasiunas at sap.com> wrote:
> Hello,
>
> Philipp Becker and me, Vaidas Gasiunas, are developers at SAP and part of a team developing a C-like domain-specific language for the SAP HANA in-memory database. We use LLVM as a backend to translate our language to native code, primarily on x86-64 platforms. Our programs are created dynamically, compiled and optimized in a running database. As a result of that we have special requirements with respect to response time and safety. In particular, we have to avoid long compile times and must deal with error situations like out-of-memory without crashing or producing memory leaks in the compiler. The compiler performance is especially important since that we must compile generated functions which tend to be rather long - in the range of thousands of LOC per function.
>
> To address these requirements we have developed a set of patches improving performance and malfunction safety of certain compiler passes and would be interested in contributing them at some point. Before proposing concrete changes, we would like to know what the general interest is with respect to making LLVM safer in out-of-memory situations.
>

Did you look into another way of looking at this.
E.g.  I have source code X. I have 1 Gig of RAM and no SWAP file. Will
LLVM compile it or run out of memory in the process?

Running LLVM and being able to retrieve stats like "Max RAM used
during compile" might be a workable solution to mitigate the
likelihood of OOM.

The reason I am interested in this is that cloud computing sometimes
gives you cheap Virtual Machines with quite low limits for resources
like RAM.
It would be nice to know before trying to compile some source code,
that it will not fail due to OOM before you start.

Kind Regards

James




More information about the llvm-dev mailing list