Tuscany
  1. Tuscany
  2. TUSCANY-1872

DAS CommandImpl(String) leaks EMF/XSD XSDImportImpl objects for sdoModel.xsd

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: Java-DAS-Next
    • Fix Version/s: Java-DAS-Next
    • Component/s: Java DAS RDB
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      Whenever a DAS rdb.impl.CommandImpl is constructed, it attempts to re-load the schema definition for the "commonj.sdo/java" namespace which imports the "commonj.sdo" namespace. For each XSDHelper.define() invocation, an new XSDImportImpl is allocated which contains its own XSDSchemaImpl object for the "commonj.sdo" namespace which is 25K in size. Many constructions of the DAS rdb.impl.CommandImpl will eventually cause an OutOfMemoryException.

      Tuscany SDO already pre-defines the "commonj.sdo/java" namespace as part of its initialization. According to JIRA issue TUSCANY-20, this used to not be the case. Now that TUSCANY-20 is fixed, the DAS should no longer be attempting to define the "commonj.sdo/java" types.

      The patch below removes these lines of code which are causing the memory leak. Please apply ASAP.

      Thanks,

      • Ron

      Index: C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java
      ===================================================================
      — C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java (revision 584191)
      +++ C:/development/working/1/tuscany-das/das/rdb/src/main/java/org/apache/tuscany/das/rdb/impl/CommandImpl.java (working copy)
      @@ -39,20 +39,6 @@

      public CommandImpl(String sqlString) {
      statement = new Statement(sqlString);
      -

      • try {
      • URL url = getClass().getResource("/xml/sdoJava.xsd");
      • if (url == null) { - throw new RuntimeException("Could not find resource: xml/sdoJava.xsd"); - }

        -

      • InputStream inputStream = url.openStream();
      • XSDHelper.INSTANCE.define(inputStream, url.toString());
      • inputStream.close();
      • } catch (IOException ex) { - throw new RuntimeException(ex); - }

        -
        }

      public CommandImpl(org.apache.tuscany.das.rdb.config.Command command) {

        Activity

        ant elder made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Luciano Resende made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Luciano Resende made changes -
        Field Original Value New Value
        Assignee Luciano Resende [ luciano resende ]
        Ron Gavlin created issue -

          People

          • Assignee:
            Luciano Resende
            Reporter:
            Ron Gavlin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development