---
title: stackSize
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/thread/stacksize
---

# stackSize

The stack size of the receiver, in bytes.

## Declaration

```swift
var stackSize: Int { get set }
```

## Discussion

Discussion This value must be in bytes and a multiple of 4KB. To change the stack size, you must set this property before starting your thread. Setting the stack size after the thread has started changes the attribute size (which is reflected by the stackSize method), but it does not affect the actual number of pages set aside for the thread.

## See Also

### Working with Thread Properties

- [threadDictionary](foundation/thread/threaddictionary.md)
- [NSAssertionHandlerKey](foundation/nsassertionhandlerkey.md)
- [name](foundation/thread/name.md)
