The root of your problem is that something is holding onto the old EntityManagers. After the end of the transaction the container should be releasing references to them and they should be free to garbage collect, so it should not matter what they reference.
Ensure that nothing in your app references any of the entity objects, as they can hold a reference to their entity manager and prevent gc. Also what is the @Yam annotation, check that it is not holding a reference. Try using a memory profiler to determine what is holding onto the objects.
Your em.clear() after the commit will do nothing, as for a JTA managed EntityManager you will get a new EntityManager after the end of the transaction, so calling em.clear() after commit will only create a new EntityManager.
You can clear the EntityManager before the commit by first calling flush.
That should resolve your issue, but you should find the root of what is holding onto your EntityManagers.