#Cannot exceed budget of 16777216 in BlockAllocator
1 messages · Page 1 of 1 (latest)
pretty sure you've hit some chunk or archetype limit
entities->m_ArchetypeChunkAllocator = new BlockAllocator(AllocatorManager.Persistent, 16 * 1024 * 1024); // 16MB should be enough```
if you bump this up does it go away
line 677 EntityComponentStore (in 1.1.0)
it's a strong sign you're doing too many add/remove components though
I checked from the archetype window, and it seems to have around 9 MB occupied when this issue gets triggered, following the stack trace from the debugger, the command buffer generating it seems to have ~11 operations, with a bunch of add/remove of tags
Doesn't the archetype window show memory used by chunks
Not the actual archetypes
Chunk memory is unlimited*
This type of chain of structural changes will create a huge amount of archetype variations really quick
If you must do archetype changes at least use the overload that can do a bunch of add or removes at once
You can only have around 8-10k unique archetypes
If you do the maths, that's about 12-13 components and every variation
i have ~300 archetypes atm
🧐 I get this error before. Merge archetype as much as possible to fix it.
You have 300 active or 300 total
Because im doubtful you have 300
probably active
In archetype window show empty archetypes
ok, total archetype 1668
You have 300 active archetypes, if you have 11 pertains to get here from a single job that's potentially 3000 archetypes
From 1 job
Now do every other command buffer
🤔 I believe the maximum achetype count limit at runtime is 1024. More than 1024 archetype will throw u the error
What's the overload to make all those add/remove in a single structural change? Can't find it
"public void EntityCommandBuffer.AddComponent(int sortKey, Entity e, in ComponentTypeSet typeSet)" ?
oh yeah thats what it's called now
if you have say 6 components
and call Add 6 times in a row
that's 6 new archetypes you've created
if you do this, it won't create each individual varation, only the final one
also check out the memory profiler for entities
it should let you see your archetypes properly -edit- i lied shows the same info
ok, many thanks, i'll try this and come back if still have the issue
@obtuse island Is there also an operation which allows multiple different operations (both add and remove) in a single structural change ?
SetARchetype
Hello there again, unfortunately i've tryed optimize all the places where i make adds or removes, but still have the issue
What's the archetype count and how much is ur structural changes now?
How often are you adding and removing components? And how many total components do you have that you add or remove
Normally around 2-6 add/remove of various components each frame, at some specific peaks around 12-15