3 Replies Latest reply on Jul 10, 2003 12:30 AM by Jon Barnett

    JBoss Holding up DiskSpace

    cibo_1 Newbie

      Hi, I was wondering if anyone out there is experiencing the problem that I'm having:

      Currently I'm LoadTesting Webservice on JBoss.
      However, everytime image retrieval is made from repository, it seems that JBoss will use up to 7 times of the size of the image itself.

      For example:
      After retrieving 34MB file, I found out that I have lost about 200MB of Available DiskSpace.
      However, if JBoss is stopped, it will then release this 200 MB Space. I also found out that leaving JBoss idle overnight, and it will release this 200MB Space (could this be when the Java Garbage collector is doing it's job?).

      I have been searching around, but found no solution to this. Is this a normal behaviour of JBoss?

      I am currently using Oracle database, JBoss running on SunOS, W2K IIS.

      Could anyone explain to me of what's happening?
      Thanks in advance.

        • 1. Re: JBoss Holding up DiskSpace
          Jon Barnett Master

          Yes, the cleanup is probably the result of a GC operation.

          It isn't necessarily a JBoss problem. But we need to clarify a few things - I'm assuming that you are actually talking about a web application rather than a Web service and that you are getting an BLOB from the database.

          How much physical memory have you got in the server? If you are consuming disk space when you application runs, it means that the system must be commiting program and data to swap space because you don't have sufficient physical memory to house the entire image. If this is not the case, you probably need to explain this some more.

          You also need to look at the way you are processing and consuming the data. My guess is that you are materialising the BLOB and then copying that from the EJB to the servlet? You can cut down consumption by using the local interface call from the embedded servlet container to the EJB. In JBoss, this allows the servlet to use the same data image as the EJB rather than operating on a copy. It also improves performance, bypassing the data copy operation.

          Also look at your coding techniques and use of data structures - there are plenty of reports and tutorials on squeezing optimal memory use out of your data routines.

          In the end, JBoss has probably little to do with your particular situation. However, you do need to consider a few things if you are using entity beans - such as the read-ahead settings, commit and release and so on. Aside from that, it will be up to you, based on your analysis of the implementation, to determine how to tweak your application's memory usage.

          The entity bean tuning guide is:

          • 2. Re: JBoss Holding up DiskSpace
            cibo_1 Newbie

            HI, I am actually running a Webservice (however, the webservice itself is published as an ejb).
            The physical memory on the server is 512M.
            In your reply, were you referring to -> Running out of physical memory would actually uses the diskspace as memory replacement?


            • 3. Re: JBoss Holding up DiskSpace
              Jon Barnett Master

              For most swapouts I would expect the SWAP to be used by OS. Since it seems you were not talking about that type of usage, there must be some other temporary files being created.

              Are you able to locate and identify these files? For example in /tmp or in any of the JBoss work directories or in the JBoss bin or conf directories? Sometimes file artifacts appear here but usually disappear as a result of cleanup or when JBoss is shutdown.

              If you are using third party libraries, I guess it is possible that they manifest a temporary file to do whatever processing they require, particularly if what they are doing (like manipulating large XML files) cannot be contained in physical memory.

              Since the container is long running, and if the application does not explicitly remove handles to temporary files, they may not be removed until the EJB dies. Just a thought and a guess.

              Try and locate these files, and also determine when they are created and by whom. It will help determine what is going on with your application. But whatever is happening is probably not being caused by JBoss.