-
1. Re: Bad Performance on Singleton Session EJBs ?
wdfink Jul 4, 2014 1:50 PM (in response to rsoika)1 of 1 people found this helpfulThere are several hits if you search for the error message, as example see http://www.mohancheema.net/appserver/java-hotspottm-64-bit-server-vm-warning-failed-to-reserve-shared-memory-errno-12
If you invoke the singleton, did you run multithreaded? Maybe a locking issue.
Otherwise, can you compare whether the business code in your method took this time or does it use the same time, in this case it points to something invocation related.
-
2. Re: Bad Performance on Singleton Session EJBs ?
kwintesencja Jul 5, 2014 7:21 PM (in response to wdfink)or any idea what I could try to get better performance?
Hi there, i have some advices and maybe it works for you.
Singleton EJBs are transactional and blocking by default, for a cache manager i think its not the best approach, i would use the following to revert that:
@Singleton @ConcurrencyManagement(ConcurrencyManagementType.BEAN)//means every method is non blocking so multiple threads can access it at the same time @TransactionAttribute(TransactionAttributeType.SUPPORTS) public class ProfileService implements Serializable{ private ConcurrentHashMap cache;//treats concurrence }
i hope it helps.
reference:
[1] http://www.adam-bien.com/roller/abien/entry/singleton_the_perfect_cache_facade
-
3. Re: Bad Performance on Singleton Session EJBs ?
rsoika Jul 18, 2014 1:54 PM (in response to kwintesencja)Thanks for your comments. The @ConcurrencyManagement is interesting. But at the end it seems not to be the main issue.
I must investigate in more detail....
-
4. Re: Bad Performance on Singleton Session EJBs ?
rsoika Jul 18, 2014 6:38 PM (in response to rsoika)Ok - after all there is no performance issue. After I run WildFly and GlassFIsh with same VM options and JDBC Driver they are equal.
Singleton Session EJBs are no issue.
Thanks for help.