Are you running this in a cloud environment? Or on a dedicated server?
1) Why is there a 2gb ear in your application? Is this due to static files like images, video, audio, etc?
If this is the case I suggest you set up a web server separately to the JBoss process in order to serve your static resources. Here we have built a static.****.com in order to serve static resources so we wouldn't have to be uploading huge war / ear files and having JBoss deal with such huge deployments. Moreover, if you ever need to scale this app by setting up a cluster you will definitely pay for a lot of bandwith while uploading and deploying to your server since JBoss domain controller will have to push your deployment to your slave hosts as well.
Sometimes, wise architecture decisions may save your day.
2) I would definitely try increasing the memory parameters within the JVM in order to see whether the behavior is the same or not, probably it won't entirely solve your problem, but it will certainly help in figuring out how to solve it.
In JBoss AS7 you can increase the memory settings by editing the file standalone.conf
JAVA_OPTS=-Xms64M -Xmx512M -XX:MaxPermSize=256M
Or if you are in domain mode, change this setting for your current parent process but don't forget to increase memory for the child processes running your servers.
Let us know if anything changes.
Thanks for your detailed response.
1) This ear is bundled in a such a way that this is heavy in size, bringing the web server and using that to server static data involve lot of efforts, so this option cannnot be used.
2) I try to change the heap size to 5gb and also given high priority to the user also. Still the same issue persists.
Increase deployment timeout in deployment-scanner subsystem
I tried to increase timeout value till 6000 , its same error.
Anything tuning should be done from OS side ?