See <http://bugzilla.redhat.com/bugzilla> for instructions.
```
**Background**
The cpp compiler runs out of memory and crashes.
**Background**
You can see the effect by running htop in a separate terminal:
The cpp compiler runs out of memory and crashes. You can see the effect by running htop in a separate terminal, all memory (including swap space) is consumed by the g++ compiler, which consequently crashes.
All memory (including swap space) is consumed by the g++ compiler, which consequently crashes.
Memory needed for building a given ICD module: There is a base load that is the same for all ICD modules. On top of that,
the ICD file contents determine how much memory is needed to build the module.
The issue is under investigation: [ECII-109](https://jira.eso.org/browse/ECII-109)
_Rule of Thumb_
**Solution**
| MAL version | Base Load | Mem per ICD-Struct |
| --- | ---- | ---- |
| MAL 1.8 | 650 MB (2/3 GB) | 320 MB (1/3 GB) |
| MAL 2.0 | 650 MB (2/3 GB) | 110 MB (1/8 GB) |
Until the problem is solved, use the following workarounds (in increasing order of invasiveness):
So building an ICD with 20 structs under MAL 1.8 will require around 7 GB of available free memory for the gcc compiler.
1. Make sure to not have elasticsearch running
_Measuring_
Record metrics of the ICD build with this time-command:
```
systemctl stop elasticsearch
$ alias time='TIME="real\t%E\nmem\t%Mk\ncpu\t%P\npf\t%F" time'
$ time waf build
[...]
real 10:28.19
mem 7206676k
cpu 765%
pf 166
```
2. Prevent waf from spawning parallel build processes:
- If you see high page fault counts (`pf 1168635`), see next section.
- If the build process crashes, the time-command's output will not be fully reliable (it will show lower statistics than what they are in reality). See next section.
```
waf -j1 build
```
More info is available at [ECII-109](https://jira.eso.org/browse/ECII-109)
3. Add temporary swap space to your machine
As root:
**Solution 1: Remove unnecessary middlewares**
Example module-wscipt:
```python
fromwtoolsimportmodule
# Disable OPCUA and DDS, since not part of this interface.