CLR_E_OUT_OF_MEMORY when adding Thread

Setup: G120 with Netmf 4.3

I tried to add a thread to my application to periodically uppdate the clock
from ntp. When I add the thread the project no longer builds under Debug config,
and the error message is CLR_E_OUT_OF_MEMORY.

I tried to just add a thread with a single Thread.Sleep in it but that doesn’t work either.

Is there a maximum number of threads that can be used?

The project still builds with Release config.

Yes there is but the number should be high. How many threads do you have?

if the project will not build, sounds like too much code/data in one assembly. There is a maximum assembly size limitation. Add a library project, and move some of the code to it.

1 Like

This was indeed the case :slight_smile: