balenaOS 2.46.1+rev1 crashed with pthread_create failed: Resource temporarily unavailable

Hi, thanks for the stack trace. This looks to be the same problem we have been debugging before. In summary, there are two things that can cause it:

  • Reaching the maximum number of threads. For a balena application container this is actually around 4915.
  • Insufficient memory (less likely)
    As it seems you are not able to easily reproduce this I would suggest you setup a test system where the problem can be reproduced and you remove the system wide thread limit by configuring /etc/systemd/system.conf with:
DefaultTasksMax=infinity
1 Like