We have used jboss pojo cache (1.4.1.SP12) in our application. We are observing that our application runs OOM (out of memory) because of large number of jboss objects hanging around in the memory. We have confirmed that objects are being evicted but not being freed from memory.

I found following information in PojoCache.pdf (JBoss Release 1.4.1 "Cayenne").

5.2. DetachmentObject removeObject(Fqn fqn) throws CacheException;

This call will detach the POJO from the cache management by removing the contents under fqn and return the POJO instance stored there (null if it doesn't exist). After successfully call, any POJO operation on the returned POJO reference is not intercepted by the cache system anymore. So in essence, you will use this Api should you decide that the POJO under fqn is no longer necessary. For example, if a POJO is no longer in context, you will need explicitly invoke this Api otherwise it won't get garbage collected by the VM. Note this call will also remove everything stored under fqn even if you have put other plain cache data there.

According to this the jboss objects wont get GC unless we call removeObject, can't this be done automatically by JBoss when the object gets evicted? Or is there a way to do this by writting an Interceptor?

You have to bear in mind that eviction with PojoCache is not the same as eviction with core Cache because the user can still hold to a reference to an object. In other words, from PojoCache's perspective, all we can do on eviction is to untie the link between the cache and the target object itself but for it to be garbaged collected, the client code needs to make sure it doesn't hold any strong references to it any more.

The limitation though expressed by PojoCache 1.4 API is no longer applicable to PojoCache 3.0, so I'd suggest that you move to that version asap.