To improve the performance of 4.2 and 5.1 you should look into the wiki pages for tuning and sliming.
With a new JBoss version you might have unused new features that can be deactivated.
Also a 'highly recommended change' see http://community.jboss.org/message/555231#555231
The wiki can be found here:
JBoss 5.x Tuning/Slimming
JBossASTuningSliming (4.x)