Best way in Unity is to use UnsafeUtility from Unity.Collections.LowLevel.Unsafe namespace:
int sizeOfStructure = UnsafeUtility.SizeOf<VertexData>();