为什么在Web应用程序中进行垃圾收集?

Consider building a web app on a platform where every request is handled by a User Level Thread(ULT) (green thread/erlang process/goroutine/... any light weight thread). Assuming every request is stateless and resources like DB connection are obtained at startup of the app and shared between these threads. What is the need for garbage collection in these threads?

Generally such a thread is short running(a few milliseconds) and if well designed doesn't use more than a few (KB or MB) of memory. If garbage collection of the resources allocated in the thread is done at the exit of the thread and independent of the other threads, then there would be no GC pauses for even the 98th or 99th percentile of requests. All requests would be answered in predictable time.

What is the problem with such a model and why is it not being widely used?

You assumption might not be true.

if well designed doesn't use more than a few (KB or MB) of memory

Imagine a function for counting words in a text file which is used in a web app. Some naive implementation could be,

def count_words(text):
    words = text.split()
    count = {}
    for w in words:
        if w in count:
            count[w] += 1
        else:
            count[w] = 1
    return count

It allocates larger memory than text.