Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Size of an empty DynamicBuffer

Discussion in 'Entity Component System' started by PublicEnumE, Jun 3, 2020.

  1. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    729
    How much ram does an empty DynamicBuffer use in a chunk?

    Is it dependent on the size of IBufferElementData type? For example, does an empty DB always allocate
    sizeof(myBufferElementType) * InternalBufferCapacity
    (assuming that is small enough to fit in the chunk), even if the buffer's length is zero?

    I'm wondering if the impact of having several empty DynamicBuffers in a chunk would be significantly worse (for chunk allocation) than the impact of having several, currently unused components.
     
  2. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    729