• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Jboss 7.1 - Temporary Files Cleanup & Open Files

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

We use JBoss 7.1 Application Server which is present at Path: /usr/share/jboss-as/standalone
And have an issue with JBoss 7.1 creating a lot of Temporary files when started using command: service jboss restart

As a workaround to avoid Disk Space being consumed, we clean up Temporary files at Path: /usr/share/jboss-as/standalone/tmp/vfs

However, we see that the JBoss process still marks these Temporary Files as Open even when Deleted.

We tried Configuration options below, but they do not seem to work for JBoss 7.1
-Djboss.vfs.cache=org.jboss.virtual.plugins.cache.IterableTimedVFSCache -Djboss.vfs.cache.TimedPolicyCaching.lifetime=1440


Can someone please help with some solutions on how to go about cleaning Temporary Files for JBoss 7.1?
As of now, migrating to WildFly is not a preferred solution as it would require a lot of Testing for Performance & Applications Deployed.
Is there a patch we could apply so that the JBoss service handles the Temporary Files itself?

Please advise.

Thanks,
Sheldon
 
Saloon Keeper
Posts: 23409
159
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wildfly no longer incorporates Tomcat in it, so policy may be different now, but In Tomcat the best way to deal with temporary files is to simply use the java.io.File mktempfile. Tomcat reconfigures mktempfile to default to putting tempfiles in the TOMCAT_HOME/work directory, although that's a Tomcat option I've had to override when I was working with an app that created really big tempfiles. Also use the delete-on-close option for better housekeeping. Saves having to code explicit deletion logic.

Orphaned open files are basically bad programming, and ultimately I don't think anything short of a JVM restart will unlock them, In the mean time find out who's being sloppy and give them a stern talking to. NOTE THAT the garbage collector is NOT a good way to close files. Always close them explicitly! I saw first-hand what happened when I had to clean up after someone who thought that once a file object went out of scope it immediately closed.

Ideallly the above will be all you need. Anything left should be tracked down and corrected.

Caching and tempfiles are two very different things, so don't expect any joy from tweaking cache options. There should be some tempfile options available, though just as in Tomcat.
 
Sheldon Dsouza
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please Note:

The Temporary Files are created Automatically by the Jboss 7.1 Server when Started up.
And we dont have any control on it.
Temporary Files Path: /usr/share/jboss-as/standalone/tmp/vfs/
where JBoss 7.1 is available at Path:  /usr/share/jboss-as/


The only thing we could do is write a script that runs at a pre-defined frequency (once a day) and Deletes the Temporary files at Path: /usr/share/jboss-as/standalone/tmp/vfs/
But, unfortunately JBoss is still marking the Temporary Files as Open even when Deleted.

Hence, asking if a patch or configuration option is available for JBoss 7.1 so that JBoss automatically cleans up its own Temporary Files.

Please advise.

Thanks,
Sheldon
 
Tim Holloway
Saloon Keeper
Posts: 23409
159
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK. this doesn't look like application temporary files, but rather they are workfiles for the VFS component of JBoss and from what I can tell contain things like the internally digested components (WARs, EARS, and so forth) and logfiles.

Despite the name, they appear to be "temporary" only in that when JBoss isn't running, tney are not needed, and your biggest clue to that is that the files are kept open. Meaning that they are actively being used, even if only rarely.

The only time you can actually delete those files, then, is when the JBoss JVM is shut down. And if some of those files are internal deployment data, it will probably make starting JBoss slower to start up again as it re-constructs them. On Unix systems, a file is not truly deleted (nor is ists space recoverable) until it is closed, since unlike Microsoft Windows, which locks on file names, Unix/Limux locks on file inodes and "deletion" merely removes the link between the directory name and the root inode of the file.

Having said that, there do appear to be JBoss releases that were careless in their vfs tempfile management, but the only fix was to move to a JBoss release that didn't have the problem.

That's about all I can offer. VFS was added to JBoss after people stopped paying me to work with it, so I'm having to deduce things based on the documentation. For anything more detailed, I recommend contacting JBoss support.



 
Sheldon Dsouza
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Tim for the quick reply.

Do you know if there is an Email Address / Site where we can contact JBoss Support?

I  tried one site for instance - https://jbossforums.jboss.org
And then Community -> User Forum, but it gives an error below.

Not Found
The requested URL /nfm/redirectToCSForum.jspa---module=bb&op=viewforum&f=247 was not found on this server.

Can you please advise on how we could get in touch with JBoss Support?

Thanks,
Sheldon
 
Tim Holloway
Saloon Keeper
Posts: 23409
159
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JBoss Forums is a JSF-based product similar to the CodeRanch forum software (but not TOO similar! The Ranch isn't a JSF app for that matter). So JBoss Forum is forum software you can install and use, not the forum for JBoss support!

What you want I think is over here: https://www.wildfly.org/ They appear to be hosting support under Google Groups. I think they may also be on Twitter, but I have doubts about Twitter being a good medium for help.

I recommend you do a quick search for vfs before asking questions that they might turn out to be annoyed at answering for the possibly 10 millionth time.
 
Then YOU must do the pig's work! Read this tiny ad. READ IT!
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic