Skip to content

Out of Memory error and process killed while Installing esp32 core in EC2 Instance (Free Tier Ubuntu) #2175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
3 tasks done
DevsBotIOT opened this issue May 9, 2023 · 2 comments · Fixed by #2187
Closed
3 tasks done
Assignees
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement type: imperfection Perceived defect in any part of project

Comments

@DevsBotIOT
Copy link

Describe the problem

I was trying to install esp32 core arduino-cli in EC2 Free (t1.micro Instance). By using this https://lindevs.com/install-arduino-cli-on-ubuntu I have installed Arduino-cli. After that I issued the below commands.

arduino-cli config init
sudo nano /home/ubuntu/.arduino15/arduino-cli.yaml (updated additional-urls ["https://espressif.github.io/arduino-esp32/package_esp32_index.json"])
arduino-cli core update-index --config-file .arduino15/arduino-cli.yaml
arduino-cli config dump =[shows additional-urls esp32 link]
arduino-cli core install esp32:esp32

At the last command, starting seems to be running smooth and at the final esp32 installation it hangs for few minutes and got a message killed and the installation stops. I tried many times and same result. I Checked the /var/log/kern.log and I found this

/var/log/kern.log
May 9 10:06:53 ip-172-31-5-99 kernel: [7260893.611782] Out of memory: Killed process 402210 (arduino-cli) total-vm:1399256kB, anon-rss:682408kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:1448kB oom_score_adj:0

To reproduce

arduino-cli config init
sudo nano /home/ubuntu/.arduino15/arduino-cli.yaml (updated additional-urls ["https://espressif.github.io/arduino-esp32/package_esp32_index.json"])
arduino-cli core update-index --config-file .arduino15/arduino-cli.yaml
arduino-cli config dump =[shows additional-urls esp32 link]
arduino-cli core install esp32:esp32

Expected behavior

esp32 core must be installed after the command.

Arduino CLI version

0.32.2

Operating system

Linux

Operating system version

22.04.01

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the nightly build
  • My report contains all necessary details
@DevsBotIOT DevsBotIOT added the type: imperfection Perceived defect in any part of project label May 9, 2023
@umbynos umbynos self-assigned this May 18, 2023
@umbynos
Copy link
Contributor

umbynos commented May 18, 2023

Hi @DevsBotIOT, this seems related to #1568 and #1059. And the high memory usage should be solved by #981. To me it seems that you are trying to install a 3rd party core to a low resource system. Unfortunately I think there is nothing we can do.. But I can suggest to upgrade to an ec2 instance with more RAM

@umbynos umbynos closed this as completed May 18, 2023
@umbynos umbynos added the conclusion: duplicate Has already been submitted label May 18, 2023
@umbynos
Copy link
Contributor

umbynos commented May 22, 2023

Hi again @DevsBotIOT, I took some time today to investigate your problem and after a bit of research on how to perform memory profiling in golang I got some results using pprof (:exploding_head: ):
I run (on a 64bit system) ./arduino-cli core install esp32:esp32 --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json:
image
Apparently, the functions allocating the majority of memory are the one bound to the file-system operations: the archive extraction. I would like to keep this issue open, so that in the future we can investigate if something could be done in order to optimize this.

@umbynos umbynos reopened this May 22, 2023
@umbynos umbynos added type: enhancement Proposed improvement topic: code Related to content of the project itself and removed conclusion: duplicate Has already been submitted labels May 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants