Here you can find the source of clearContextCache()
public synchronized static void clearContextCache()
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); import java.lang.ref.SoftReference; import java.util.HashMap; import java.util.Map; import javax.xml.bind.JAXBContext; public class Main { private static final Map<Class<?>, SoftReference<JAXBContext>> contextCache = new HashMap<>(); /**/* w w w .j ava2 s . c om*/ * @since 3.6 */ public synchronized static void clearContextCache() { for (SoftReference<JAXBContext> i : contextCache.values()) i.clear(); contextCache.clear(); } /** * @since 3.6 */ public synchronized static void clearContextCache(final Class<?> bind) { SoftReference<JAXBContext> ref = contextCache.get(bind); if (ref != null) { ref.clear(); contextCache.remove(bind); } } }