new, malloc() 같은 함수로 메모리를 할당free(), delete)하지 않으면 메모리 누수 발생 가능🔹 예제 (Dart)
class User {
String name;
User(this.name);
}
void main() {
User user = User("Alice"); // Heap 메모리에 할당
}
✅ User 객체는 Heap에 저장되고, user 변수는 Stack에서 Heap을 참조하는 구조야.