I was reading the Javascript tutorial of Mozilla and I come through this piece of information.
High-level languages embed a piece of software called "garbage collector" whose job is to track memory allocation and use in order to find when a piece of allocated memory is not needed any longer in which case, it will automatically free it. This process is an approximation since the general problem of knowing whether some piece of memory is needed is undecidable (can't be solved by an algorithm).
I am familiar with the notion of undecidability and garbage collector, but I can't seem to understand why this is an undecidable problem?