# OS build errors

**URL:** <https://get-help.theconstruct.ai/t/os-build-errors/25141>\
**Category:** ROS2 Basics in 5 Days Humble (C++)\
**Created:** [June 27, 2023, 7:14pm UTC](https://get-help.theconstruct.ai/t/os-build-errors/25141 "2023-06-27T19:14:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![z4ziad](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/z/c37758/32.png) [@z4ziad](https://get-help.theconstruct.ai/u/z4ziad)\
**Post date:** [June 27, 2023, 7:14pm UTC](https://get-help.theconstruct.ai/t/os-build-errors/25141/1 "2023-06-27T19:14:23Z")

</div>

I am getting the following error when building a package. Any idea? It seems the OS is running out of memeory!

[76.549s] ERROR:colcon.colcon\_core.event\_reactor:Exception in event handler extension ‘event\_log’: [Errno 12] Cannot allocate memory  
Traceback (most recent call last):  
File “/usr/lib/python3/dist-packages/colcon\_core/event\_reactor.py”, line 78, in \_notify\_observers  
retval = observer(event)  
File “/usr/lib/python3/dist-packages/colcon\_output/event\_handler/event\_log.py”, line 50, in **call**  
self.\_file\_handle.flush()  
OSError: [Errno 12] Cannot allocate memory

---

<div class="post-metadata">

**Author:** ![albertoezquerro](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/albertoezquerro/32/7031_2.png) [@albertoezquerro](https://get-help.theconstruct.ai/u/albertoezquerro)\
**Post date:** [June 28, 2023, 8:18am UTC](https://get-help.theconstruct.ai/t/os-build-errors/25141/2 "2023-06-28T08:18:16Z")

</div>

Hello @z4ziad ,

Is this happening in the academy? Or on your local computer?

---

<div class="post-metadata">

**Author:** ![z4ziad](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/z/c37758/32.png) [@z4ziad](https://get-help.theconstruct.ai/u/z4ziad)\
**Post date:** [June 28, 2023, 1:40pm UTC](https://get-help.theconstruct.ai/t/os-build-errors/25141/3 "2023-06-28T13:40:56Z")

</div>

It was happening in academy or course virtual machine.

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [June 29, 2023, 8:23am UTC](https://get-help.theconstruct.ai/t/os-build-errors/25141/4 "2023-06-29T08:23:03Z")

</div>

Apologies for that. Is it still happening? If so, please let us know because then it could mean there could be something about your code that’s causing that.

---

<div class="post-metadata">

**Author:** ![z4ziad](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/z/c37758/32.png) [@z4ziad](https://get-help.theconstruct.ai/u/z4ziad)\
**Post date:** [June 29, 2023, 6:46pm UTC](https://get-help.theconstruct.ai/t/os-build-errors/25141/5 "2023-06-29T18:46:34Z")

</div>

Thanks for your reply. I had to reduce the number of executable files in my CMakeLists.txt for Unit 4 to avoid the error. I think the compiler was running out of memory, although I am clear why this would happen.

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [July 4, 2023, 6:46pm UTC](https://get-help.theconstruct.ai/t/os-build-errors/25141/6 "2023-07-04T18:46:35Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
