Node.js uses a combination of garbage collection techniques to automatically free up occupied memory when an object is no longer needed or referenced, preventing memory leaks and ensuring efficient application performance. The process includes generational garbage collection and mark-and-sweep algorithms.
