When initializing accounts, you must specify the space (size in bytes) required.
Type sizes
InitSpace derive
Use InitSpace for automatic calculation:
String and Vec lengths
Specify max lengths with attributes:
Manual calculation
Best practices
Always use InitSpace derive to avoid calculation errors.
Allocate enough space for dynamic types (String, Vec) based on expected max size.