Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-1737

OutOfMemory error when exporting/importing large Bamboo instances

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: High High
    • 2.6
    • 1.2.1, 1.2.2, 1.2.3, 1.2.4

      The Bamboo export/import process is highly inefficient

      The import process reads all XML files to memory and the SAX parser tries to parse the files off memory. For a (uncompressed) xml file size 1mb - Bamboo uses up about 7 mb of memory - this causes issues such as https://support.atlassian.com/browse/BSP-285. Where the customers exported zip file is ~50mb, this translates into about 350-400mb of uncompressed XML files being parsed by Bamboo, which requires upwards of ~3gb of heap space to be parsed successfully.

      As Bamboo instances grow with time, we can expect the Bamboo-Home exports to be massive and this issue must be addressed A.S.A.P.

          Form Name

            [BAM-1737] OutOfMemory error when exporting/importing large Bamboo instances

            Ulrich Kuhnhardt [Atlassian] added a comment - https://support.atlassian.com/browse/BSP-2171

            edwin added a comment -

            Hi Sebastian,

            Unfortunately, the work on import and export re-engineering was postponed due to other priorities. At this stage, we don't have concrete plans for the completion of that work.

            However, as Dan mentioned, you might want to follow the instructions posted by Adrian above: http://confluence.atlassian.com/display/BAMBOO/Removing+Coverage+plug-in+data+from+the+Bamboo+database to remove the coverage data from the database. Would that workaround suffice for you?

            Apologies for the inconvenience.

            Regards,
            Edwin

            edwin added a comment - Hi Sebastian, Unfortunately, the work on import and export re-engineering was postponed due to other priorities. At this stage, we don't have concrete plans for the completion of that work. However, as Dan mentioned, you might want to follow the instructions posted by Adrian above: http://confluence.atlassian.com/display/BAMBOO/Removing+Coverage+plug-in+data+from+the+Bamboo+database to remove the coverage data from the database. Would that workaround suffice for you? Apologies for the inconvenience. Regards, Edwin

            Any Statement to the status of a fix?

            I run also into troubles with importing/exporting.
            We use also the coverage addon.

            It seems that there is no fix in 2.1.
            (see BSP-1427)

            Sebastian Voigt added a comment - Any Statement to the status of a fix? I run also into troubles with importing/exporting. We use also the coverage addon. It seems that there is no fix in 2.1. (see BSP-1427)

            Thanks Adrian. Just to clarify we have been able to export successfully with artifacts, so I'm mainly concerned about the import with artifacts.

            Brad Harvey added a comment - Thanks Adrian. Just to clarify we have been able to export successfully with artifacts, so I'm mainly concerned about the import with artifacts.

            Hi Brad,

            No, including artifacts in the export should not significantly increase the memory usage requirements.

            However, you may run into another issue. If you do, please try exporting without artifacts.

            We have commenced planning for a re-engineered import/export facility for Bamboo 2.1, which will address these problems.

            Regards,
            Adrian

            Adrian Hempel [Atlassian] added a comment - Hi Brad, No, including artifacts in the export should not significantly increase the memory usage requirements. However, you may run into another issue . If you do, please try exporting without artifacts. We have commenced planning for a re-engineered import/export facility for Bamboo 2.1, which will address these problems. Regards, Adrian

            We have had the same issue exporting & importing, again due to the coverage plugin.

            I have now removed the coverage data as per http://confluence.atlassian.com/display/BAMBOO/Removing+Coverage+plug-in+data+from+the+Bamboo+database. The script file shrunk from ~200 meg to 8 meg so hopefully that's a good sign. I'm now waiting till the next out of hours period to try the export and then import again.

            FYI - I had to do a shutdown script on the hsqldb to get everything into the .script file.

            java -jar $HSQLDB_HOME/lib/hsqldb-1.8.0.7.jar --inlineRc URL=jdbc:hsqldb:file:defaultdb,USER=sa --sql 'SHUTDOWN SCRIPT;'
            

            Where HSQLDB_HOME is <bamboo_home>/web-app/WEB-INF
            Run from <bamboo_data>/database directory.

            One question - does including artifacts in the export increase the memory usage requirements?

            Thanks,
            Brad.

            Brad Harvey added a comment - We have had the same issue exporting & importing, again due to the coverage plugin. I have now removed the coverage data as per http://confluence.atlassian.com/display/BAMBOO/Removing+Coverage+plug-in+data+from+the+Bamboo+database . The script file shrunk from ~200 meg to 8 meg so hopefully that's a good sign. I'm now waiting till the next out of hours period to try the export and then import again. FYI - I had to do a shutdown script on the hsqldb to get everything into the .script file. java -jar $HSQLDB_HOME/lib/hsqldb-1.8.0.7.jar --inlineRc URL=jdbc:hsqldb:file:defaultdb,USER=sa --sql 'SHUTDOWN SCRIPT;' Where HSQLDB_HOME is <bamboo_home>/web-app/WEB-INF Run from <bamboo_data>/database directory. One question - does including artifacts in the export increase the memory usage requirements? Thanks, Brad.

            sellersj added a comment -

            Adrian Hempel from atlassian pointed me to this wiki page which helped.
            http://confluence.atlassian.com/display/BAMBOO/Removing+Coverage+plug-in+data+from+the+Bamboo+database

            I used that script and was able to successfully import the data into bamboo 2.0.

            Thanks all for your hard work and help.

            sellersj added a comment - Adrian Hempel from atlassian pointed me to this wiki page which helped. http://confluence.atlassian.com/display/BAMBOO/Removing+Coverage+plug-in+data+from+the+Bamboo+database I used that script and was able to successfully import the data into bamboo 2.0. Thanks all for your hard work and help.

            Jim,

            One alternative would be to remove the data generated by the coverage plugin before exporting from your 1.x version of Bamboo. This will prevent data from the coverage plugin from being migrated to Bamboo 2.0, but I am unsure of how useful this data would be in 2.0 anyway. The issue I fixed with multi-module statistics and one I am currently working on to reduce data storage volume required changes to the storage of code coverage data that are not backwards compatible with current versions of the plugin. Additionally, the plugin does not currently support Bamboo 2.0 and any future version that does will almost certainly have the changes I mentioned previously included. There is still the possibility of a tool to migrate existing coverage plugin data, but I am not hopeful it will come any time soon. At the moment, I am prioritizing reduction of data storage volume and Bamboo 2.0 support ahead of this capability.

            To remove the code coverage data, directly access the Bamboo database and delete the data from the buildresultsummary_customdata table. Rows with a custom_info_key value of custom.coverage.provider or starting with coverage.stat should be deleted to accomplish this.

            Note: I don't know if directly accessing the database to delete this data is a practice endorsed by Atlassian, but I have used this method to remove large amounts of coverage plugin data myself with no ill effects. AFAIK, there is no other way to accomplish this.

            Dan Grabowski added a comment - Jim, One alternative would be to remove the data generated by the coverage plugin before exporting from your 1.x version of Bamboo. This will prevent data from the coverage plugin from being migrated to Bamboo 2.0, but I am unsure of how useful this data would be in 2.0 anyway. The issue I fixed with multi-module statistics and one I am currently working on to reduce data storage volume required changes to the storage of code coverage data that are not backwards compatible with current versions of the plugin. Additionally, the plugin does not currently support Bamboo 2.0 and any future version that does will almost certainly have the changes I mentioned previously included. There is still the possibility of a tool to migrate existing coverage plugin data, but I am not hopeful it will come any time soon. At the moment, I am prioritizing reduction of data storage volume and Bamboo 2.0 support ahead of this capability. To remove the code coverage data, directly access the Bamboo database and delete the data from the buildresultsummary_customdata table. Rows with a custom_info_key value of custom.coverage.provider or starting with coverage.stat should be deleted to accomplish this. Note: I don't know if directly accessing the database to delete this data is a practice endorsed by Atlassian, but I have used this method to remove large amounts of coverage plugin data myself with no ill effects. AFAIK, there is no other way to accomplish this.

            sellersj added a comment -

            Hi Ajay.

            We've run into this issue while trying to move to 2.0 so we can use the oracle backend. We use the standalone version of bamboo.

            Our export.zip file is aprox 38M and we're not able to import the data. We also use the coverage plugin, but our export does not include any artifacts.

            Is there a way to get a patched build so we can run the import or just a stripped down import util?

            Thanks for your time.

            sellersj added a comment - Hi Ajay. We've run into this issue while trying to move to 2.0 so we can use the oracle backend. We use the standalone version of bamboo. Our export.zip file is aprox 38M and we're not able to import the data. We also use the coverage plugin, but our export does not include any artifacts. Is there a way to get a patched build so we can run the import or just a stripped down import util? Thanks for your time.

            AjayA added a comment -

            Hi Chris,

            Thank you for confirming, that you are indeed using the coverage plugin

            To keep customer data private, we intentionally restrict visibility of Support issues to "reporters and developers" - however I have attached the patched up WAR file to this support issue.

            I am not sure if you are using the standalone version or the WAR version of Bamboo, please let me know if you need a patch for the stand alone version?

            Instructions on using the WAR -

            1. Export your Bamboo instance without the artifacts,
            2. Delete the (existing) deployed Bamboo WAR,
            3. Deploy the WAR file attached to this issue,
            4. Restart Bamboo and import your Bamboo export.zip file.

            Regards,
            Ajay.

            AjayA added a comment - Hi Chris, Thank you for confirming, that you are indeed using the coverage plugin To keep customer data private, we intentionally restrict visibility of Support issues to "reporters and developers" - however I have attached the patched up WAR file to this support issue. I am not sure if you are using the standalone version or the WAR version of Bamboo, please let me know if you need a patch for the stand alone version? Instructions on using the WAR - Export your Bamboo instance without the artifacts , Delete the (existing) deployed Bamboo WAR, Deploy the WAR file attached to this issue, Restart Bamboo and import your Bamboo export.zip file. Regards, Ajay.

              Unassigned Unassigned
              asridhar AjayA
              Affected customers:
              4 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: