[java] JBoss AS 7: How to clean up tmp?

I noticed that in my JBoss Application Server 7 installation under standalone/tmp I have 400 MB of files related to past deployments, some of them a few months old.

How is it cleaned up? Should it happen automatically? Is there a tool for it? Can I just remove all those files myself?

This question is related to java jboss jboss7.x

The answer is


Files related for deployment (and others temporary items) are created in standalone/tmp/vfs (Virtual File System). You may add a policy at startup for evicting temporary files :

-Djboss.vfs.cache=org.jboss.virtual.plugins.cache.IterableTimedVFSCache 
-Djboss.vfs.cache.TimedPolicyCaching.lifetime=1440

I do not have experience with version 7 of JBoss but with 5 I often had issues when redeploying apps which went away when I cleaned the work and tmp folder. I wrote a script for that which was executed everytime the server shut down. Maybe executing it before startup is better considering abnormal shutdowns (which weren't uncommon with Jboss 5 :))