Do they load all classes when tomcat
is started even when there is no
request?
The answer is maybe. The strategy used is down to your JVM implementation. More often than not classes are only loaded when they are required.
Or they load necessary classes when a
request comes in?
Again it depends on your JVM's class loader strategy. Generally speaking though classes are only loaded when they are needed. For example, if request 1 doesn't needed class Foo but request 2 does then the class will only be loaded during request 2.
And how about the life cycle of the
loaded classes?
Instances of the classes follow the normal garbage collection rules so they're deleted when there are no longer any references to them. As for the classes themselves, I'm not entirely sure. I'd imagine they follow a similar pattern, i.e. if there are no instances of the class left and the JVM needs more memory they it unloads the class.