Affects Version/s: 2.2.4u2, 2.2.5, 2.2.6, 2.2.7
Fix Version/s: None
During upgrading a web service we observed that a the Parallel new garbage collector was unable to achieve the previously seen thoughput when running with JAXB 2.2.5+
On investigation it seems the reason for this is the addition of the `finalize()` method on `UnmarshallerImpl`, this causes the object not to be collected but to be placed to to the finalizer queue. This is problematic for two reasons
- it increases the contention on the finalizer queue
- The last unmarshalled object (a large WS response object in our case) is retained until the finalizer invokes the `finalize()` method
In addition, the implementation of the `finalize()` method:
is broken because the `ClassFactory.cleanCache()` method needs to be called in the same thread as the original use of the `Unmarshaller`, but this won't be true as it will be called the Finalizer thread.
Will be posting a patch to remove the method to the dev mailing list.