Main Site Documentation

CLR_E_OUT_OF_MEMORY when adding Thread


#1

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.


#2

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


#3

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.


#4

This was indeed the case :slight_smile: