Memory leak when (un-)parenting entities?

Hey guys,

I have a pick and place system for a robot arm. The objects to pick are spawned on a conveyor and are moved by physics, but will be set to kinematic childs of the robot arm while picked. My memory consumption is slowly increasing when doing the (un-)parenting until it might crash at some time. If I comment those lines (11 & 27) out, the memory consumption is fine.

Hopefully you have an idea, what I am doing wrong here. Thank you very much.

[BurstCompile]
public partial struct PickTargetJob : IJobEntity {
public void Execute(Entity entity, ref RobotToolComponent tool)
        {
            // pick
            if (tool.GripperIsActive && tool.CarriedEntity == Entity.Null)
            {
                // [...] Raycast stuff to get a reference to the correct entity
                  {
                        Ecb.AddComponent(hit.Entity, new PhysicsMassOverride() { IsKinematic = 1, SetVelocityToZero = 1 });
                        Ecb.AddComponent(hit.Entity, new Parent { Value = entity }); // This seems to cause the memory leak
                        Ecb.SetComponent(hit.Entity, LocalTransform.FromMatrix(matrix));
                        tool.CarriedEntity = hit.Entity;
                    }
                }
            }

            // place
            else if (tool.GripperIsActive == false)
            {
                // [...]

                if (tool.CarriedEntity != Entity.Null)
                {
                    // [...]

                    Ecb.RemoveComponent<Parent>(tool.CarriedEntity); // This seems to cause the memory leak
                    Ecb.SetComponent(tool.CarriedEntity, LocalTransform.FromMatrix(matrix));
                    Ecb.SetComponent(tool.CarriedEntity, new PhysicsMassOverride() { IsKinematic = 0, SetVelocityToZero = 0 });
                    Ecb.SetComponent(tool.CarriedEntity, new PhysicsVelocity { Linear = velocity});
                    tool.CarriedEntity = Entity.Null;
                }
            }

        }

Still an issue. Is there any information missing from my side?

After some research, I think it might has something to do with memory / chunk fragmentation.

I create around 2 new products each second on conveyor A, which will be picked and placed onto conveyor B, where they will be transported to the end and fall on the ground. Then they get destroyed.

I think, because I am adding/removing the Parent component, the archetype changes and the entity gets moved to another chunk and is generating fragmentation.

Another thing is, that I can only see this memory issue in the build, not in the editor. When having the memory profiler connected to the development build, it just says I have a difference in reserved or unused native memory.

Here is a comparison of just 10 minute long run:

Any ideas how I can build a workaround?