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

Hi all,

As the title suggests, last week one of my devices (Raspberry Pi 3B+) running BalenaOS (2.46.1+rev1) failed.
This has left me with a stacktrace of about 1000 lines (balenad_crash.log (149.6 KB) ).

Of course, I would like to prevent this from happening in the future, so I was wondering if someone can point me in the right direction.
In my (3 years?) experience with Balena, this has been the first time I’ve ever seen such a crash.

My application uses a relatively large number of threads, so judging from the error message, I’m assuming I’m hitting a limit there.
Is there something of a practical limit to the number of threads used on Raspberry Pi 3B+ with Balena?
Are there any other things I can keep an eye on to prevent this from happening?

Updating the HostOS is an option, but not ideal due to some manual changes I have made to it.
I also don’t have direct access to the physical device as it has been deployed abroad.

Thanks in advance,
TJvV