Why would a view allocate so much memory?
Because it’s not a zero-cost abstraction, and the view object needs space to describe what the view is covering.
julia> A = zeros(UInt8, 7, 9);
julia> a = view(A, 1:3, 1);
In your example, 576,000 bytes / 9,000 iterations = 64 bytes whereas
sizeof returns 48 bytes, but the difference is probably a matter of the underlying memory manager aligning the objects to word boundaries.
Also, why is A allocated using 304 bytes when the actual data it holds is 63 bytes (plus size and type information)?
Probably type information plus memory alignment, but you’ll probably need to dig into the C internals (or have someone who already knows the anwer comment) to verify if that accounts for all of the difference.