In case the heap is full, the JVM throws an OutOfMemoryError. But is it assured that a (full) garbage collection always takes place before such an exception is thrown?
There are other additional factors to consider besides what people have already answered, for example the garbage collection policy you are using. Consider the throughput garbage collection, this will throw an out of memory exception if too much time is being spent collecting and not enough memory is being freed (although the recent changes might have changed things). Having said all this I would not assume garbage collection occurs at any time within the execution of an application that I'm writing...