Flow Traders interview question

How does the programming language handle the allocated memory that doesn't have a reference? how does that work?