I've been working with oil2 for a while now and I've done some performance monitoring with it. I found a problem with HashMap$Entry instances. First I'm using Jbos 3.0.5. I have a client that kept running out of memory and as I lost memory the number of send and receives I could do began to decrease. I ran with Optimizit and discovered million of HashMap$Entry instances being created even with a small number of sends (3-5 hundred). The two places where this was happening was in Oil2SocketHandler, specifically in the two methods registerResponseSlot and pumpMessages. The same code is in both methods:
HashMap newMap = (HashMap) responseSlots.clone();
slot = (Slot) newMap.remov(response.correlationRequestId);
responseSlots = newMap;
What is happening here is an exponential increase in HashMap$Entry instances. This was very easy to identify. All you would have to do is create a client that used oil2 and send a constant stream of messages. Eventually you would eat up all of your memory.
I was able to fix this by replacing the above code to
slot = (Slot)responseSlots.removresponse.correlationRequestId);
And I had to put a synchronized block around snapShot iterator code in the pumpMessage methods finally block like this:
HashMap snapShot = responseSlots;
if (snapShot.size() > 0)
Iterator i = snapShot.values().iterator();
Slot s = (Slot) i.next();
if (s != mySlot)
I'm hoping this can be added to the source code. It completely fix the memory problem and the degredation in send and receives over time went away.
Sorry the version of JBoss I'm using is 3.0.6 and the replaced code was missing a parenthesis and should read
slot = (Slot) responseSlots.remove(response.correlationRequestId);
I've being testing OIL2 and UIL2 invocation layers in JBoss 3.2RC3 and they are very good, very fast. On my computer version 3.2RC3 is at least 3 times faster than version 3.0.x.
But in my tests I see that one problem still persist, JBossMQ does not scale well. Message throughput drops almost linearly with the number of producers/consumers.
So I would like to ask, is there any work being done to make JBossMQ scale better? If so, will it be released in the 3.2 series or 4.0 series?
Do you have any profiling data?
I've removed some of the brain deaths,
but I haven't really profiled a real jms application.
I noticed the other day that the file persistence
manager gets stuck synchronizing when creating
a new transaction.
There are plans for a major overhaul in the 4.0