Please design Java Garbage Collector and implement it.
Several key features to look for:
- A heap which represents JVM when a Java program starts.
- At least three parts in the heap that represent Eden Space, Tenured Space and Perm Space.
- Different rounds of garbage collecting in these above three spaces (checking all objects to see if they have any live references at all, if not, kill them, reclaim the allocated memory, otherwise, move them to later spaces..)