Stack memory is allocated:
- For small objects whose life cycle is only within the stack frame
 
- For small objects that could escape to heap but actually inlined
 
Heap memory is allocated:
- For small objects that will be passed across stack frames
 
- For big objects (>32KB)