The question is a bit theoretical, what is the cost of creating JAXB context, marshaller and unmarshaller?
I\'ve found that my code could benefit from keeping the sa
Ideally, you should have a singleton JAXBContext and local instances of Marshaller and Unmarshaller.
JAXBContext
Marshaller
Unmarshaller
JAXBContext instances are thread-safe while Marshaller and Unmarshaller instances are not thread-safe and should never be shared across threads.