2 Replies Latest reply on Dec 24, 2009 4:40 AM by Roded Hess

    Map (HashMap) Instance Member Performance Issue in @Service ,@Local EJB

    Roded Hess Newbie

      Hi,

      I encountered a performance issue when using the a HashMap instance contained in an EJB. I will call it A

      I used the following annotations in order to use an EJB as a singleton: @Service, @Local

      In the EJB I have a member: an instance of HashMap<String, Object>.

       

      I noticed that when I access the HashMap (via get method) from other EJB B (A is injected in B) the time in most cases is somewhere near 0 ms BUT every few iterations the time is 16ms(!).

       

      As number of these (map.get invocations) 16ms might reach 4000 this makes performance very poor.

       

      Now,

      When made EJB A(the singleton) a non EJB but just a simple POJO this behavior reduced almost to zero.

       

      What can be the explenation? Where can I start trying to understand this behavior?

       

      Thanks,

      Rod