Creating each process involves a call to the operating system, which consumes extra CPU time as well. A better model is to use multiple threads of execution, referred to as threads for short. Threads can share data and code, making it easier to share data between thread instances. They also use less memory and CPU overhead. Java has support for multiple threads of execution built right into the language.
Threads require a different way of thinking, but can be understood very quickly.
Thread support in Java is very simple to use, and the use of threads in applications and applets is quite commonplace. The term garbage collection refers to the reclamation of unused memory space. When applications create objects, the JVM allocates memory space for their storage. This adds extra complexity, but also causes another problem - memory leaks. When programmers forget to deallocate memory, the amount of free memory available is decreased.