Thread set exceeded in profiler

Hello.

I have a problem with the profiler in debug builds.

I have a scene with game objects. Every game object has a set of different visual stages (skins). Every skin is a separate game object and loads with its own factory that is marked as «load dynamically» (just to save memory).

When the number of objects on the scene exceeds ~60 I receive an error «Thread set exceeded in profiler!».

It happens at the start of the scene when all skins load simultaneously.

If I understand correctly, this is due to the fact that the profiler cannot work with more than 64 threads:
defold/profile.cpp at 1ae302ec33d4514408c04ad3ae5d3c1efe2057bd · defold/defold · GitHub.

Release build works fine.

So I have two questions:

  1. What is the reason for the number 64? Why not less or more?
  2. Is it really bad to load a large number of dynamic factories at the same time?

Current workaround is loading objects by groups with delays. And it works. But it would be great to get answers to the questions above.

Thank you

1 Like
  1. The current constant (64) is just chosen as a “good enough” size.
    I’m not entirely sure why that function doesn’t use the size available (profile->m_Samples.Size()) to calculate the the table size.

  2. There aren’t any inherent issues with having many dynamic factories. What I’d look out for is loading times, and make sure they are loaded asynchronously.

Release build works fine.

The profiler is disabled by default in release builds.

1 Like