Java manages memory automatically through garbage collection. Objects are stored in heap memory and are eligible for garbage collection when no references to the object exist. The garbage collector runs periodically in its own thread to identify dereferenced objects and free up memory. Programmers cannot force garbage collection but can request it. OutOfMemoryErrors occur when there is insufficient memory for new objects.