---
title: size
framework: swift
role: symbol
role_heading: Type Property
path: swift/memorylayout/size
---

# size

The contiguous memory footprint of T, in bytes.

## Declaration

```swift
static var size: Int { get }
```

## Discussion

Discussion A type’s size does not include any dynamically allocated or out of line storage. In particular, MemoryLayout<T>.size, when T is a class type, is the same regardless of how many stored properties T has. When allocating memory for multiple instances of T using an unsafe pointer, use a multiple of the type’s stride instead of its size.

## See Also

### Accessing the Layout of a Type

- [alignment](swift/memorylayout/alignment.md)
- [stride](swift/memorylayout/stride.md)
