Uploaded image for project: 'OpenEJB'
  1. OpenEJB
  2. OPENEJB-1265

TempClassLoader buffer reuse reduces memory requirements

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Implemented
    • 3.1.x
    • 4.7.0
    • server
    • All

    Description

      The current TempClassLoader potentially uses a new 8k ByteArrayOutputStream per class that it inspects.
      Whilst hunting for a possible ClassLoader issue I found that replacing the ByteArrayOutputStream with a reusable one leads to a substantial reduction in memory during server start up.

      I am unable to quantify what 'substantial' means in real terms as I have not run any real benchmarking, but it is fair to say that I had noticed heap sizes growing to over 180m during a server start compared to the 90m that I have now. These values would be application specific, but it would be nice to see if this is an improvement for others.

      I have also synchronized a few access methods to ensure that resources are protected during the inspection process.

      Attachments

        1. TempClassLoader.patch
          12 kB
          Andy Gumbrecht

        Activity

          People

            Unassigned Unassigned
            andyg Andy Gumbrecht
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: