Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-20952

Creating content causes a memory leak using ezfind

    Details

      Description

      using the api to create an object as described here: https://confluence.ez.no/display/EZP/3.+Managing+Content

      will cause the sequence:

      $locationCreateStruct = $locationService->newLocationCreateStruct( $parentLocationId );
      $draft = $contentService->createContent( $contentSkeleton, array( $locationCreateStruct ) );
      $content = $contentService->publishVersion( $draft->versionInfo );
      

      even after the method finishes executing. this will lead php exausting the memory when creating many objects in a loop.

        Issue Links

          Activity

          Hide
          Paulo Bras (Inactive) added a comment - - edited

          create a test bundle using the ezpublish/console script.

          put the attached file in the bundle/Command dir

          Show
          Paulo Bras (Inactive) added a comment - - edited create a test bundle using the ezpublish/console script. put the attached file in the bundle/Command dir
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          The problem does not seem to come from API but from eZ Find. Investigating.

          Show
          Jérôme Vieilledent (Inactive) added a comment - The problem does not seem to come from API but from eZ Find. Investigating.
          Show
          Jérôme Vieilledent (Inactive) added a comment - Pull-request: https://github.com/ezsystems/ezfind/pull/112
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezfind/commit/e96b73ffe324f922909c6fa09421763237399147
          Hide
          Marcos Loureiro (Inactive) added a comment -

          The following tests were done with this patch: https://gist.github.com/MarcosLoureiro/df5821e536cc5492ffb6

          First table: 5.0 with ezfind
          Second table: 5.0 with ezfind and 21055 patch
          Third table: 5.0 with ezfind, 21055 patch and 20952 patch

          ________________________
          5.0 + ezfind
           
          Initial memory value: 4226692
          Memory        |  before  |  draft   |  publish |   after  |   delta
          --------------------------------------------------------------------
          Iteration: 0  | 4226780 | 5076936 | 13637120 | 13486868 |  9260088
          Iteration: 1  | 13486956 | 13574968 | 13663024 | 13512396 |  25440
          Iteration: 2  | 13512396 | 13600916 | 13689368 | 13538040 |  25644
          Iteration: 3  | 13538040 | 13627160 | 13715512 | 13563536 |  25496
          Iteration: 4  | 13563536 | 13652732 | 13741116 | 13588948 |  25412
          Iteration: 5  | 13588948 | 13677808 | 13766104 | 13614364 |  25416
          Iteration: 6  | 13614364 | 13703264 | 13791660 | 13639728 |  25364
          Iteration: 7  | 13639728 | 13729060 | 13817392 | 13665096 |  25368
          Iteration: 8  | 13665096 | 13754476 | 13843424 | 13690596 |  25500
          Iteration: 9  | 13690596 | 13779700 | 13868172 | 13716020 |  25424
          --------------------------------------------------------------------
          Memory lost in last iteration: 25424
           
          ________________________
          5.0 + ezfind + 21055
           
          Initial memory value: 3779176
          Memory        |  before  |  draft   |  publish |   after  |   delta
          --------------------------------------------------------------------
          Iteration: 0  | 3779264 | 4066720 | 7714864 | 7574264 |  3795000
          Iteration: 1  | 7574352 | 7662272 | 7740684 | 7599724 |  25372
          Iteration: 2  | 7599724 | 7688188 | 7766864 | 7625220 |  25496
          Iteration: 3  | 7625220 | 7714260 | 7792860 | 7650600 |  25380
          Iteration: 4  | 7650600 | 7739484 | 7818256 | 7676084 |  25484
          Iteration: 5  | 7676084 | 7764908 | 7843884 | 7701460 |  25376
          Iteration: 6  | 7701460 | 7790412 | 7869196 | 7726812 |  25352
          Iteration: 7  | 7726812 | 7816044 | 7895008 | 7752184 |  25372
          Iteration: 8  | 7752184 | 7841572 | 7920700 | 7777696 |  25512
          Iteration: 9  | 7777696 | 7866844 | 7945728 | 7803104 |  25408
          --------------------------------------------------------------------
          Memory lost in last iteration: 25408
           
          ________________________
          5.0 + ezfind + 21055 + 20952
           
          Initial memory value: 3779176
          Memory        |  before  |  draft   |  publish |   after  |   delta
          --------------------------------------------------------------------
          Iteration: 0  | 3779264 | 4066720 | 7701300 | 7560664 |  3781400
          Iteration: 1  | 7560752 | 7648692 | 7717668 | 7576712 |  15960
          Iteration: 2  | 7576712 | 7665420 | 7734588 | 7592656 |  15944
          Iteration: 3  | 7592656 | 7681364 | 7750596 | 7608608 |  15952
          Iteration: 4  | 7608608 | 7697396 | 7766608 | 7624548 |  15940
          Iteration: 5  | 7624548 | 7712928 | 7782388 | 7640512 |  15964
          Iteration: 6  | 7640512 | 7729336 | 7798816 | 7656412 |  15900
          Iteration: 7  | 7656412 | 7745760 | 7815216 | 7672340 |  15928
          Iteration: 8  | 7672340 | 7761836 | 7831276 | 7688288 |  15948
          Iteration: 9  | 7688288 | 7777988 | 7847788 | 7704272 |  15984
          --------------------------------------------------------------------
          Memory lost in last iteration: 15984

          For info about the results without ezfind check: https://jira.ez.no/browse/EZP-21055?focusedCommentId=77698&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-77698

          Show
          Marcos Loureiro (Inactive) added a comment - The following tests were done with this patch: https://gist.github.com/MarcosLoureiro/df5821e536cc5492ffb6 First table: 5.0 with ezfind Second table: 5.0 with ezfind and 21055 patch Third table: 5.0 with ezfind, 21055 patch and 20952 patch ________________________ 5.0 + ezfind   Initial memory value: 4226692 Memory | before | draft | publish | after | delta -------------------------------------------------------------------- Iteration: 0 | 4226780 | 5076936 | 13637120 | 13486868 | 9260088 Iteration: 1 | 13486956 | 13574968 | 13663024 | 13512396 | 25440 Iteration: 2 | 13512396 | 13600916 | 13689368 | 13538040 | 25644 Iteration: 3 | 13538040 | 13627160 | 13715512 | 13563536 | 25496 Iteration: 4 | 13563536 | 13652732 | 13741116 | 13588948 | 25412 Iteration: 5 | 13588948 | 13677808 | 13766104 | 13614364 | 25416 Iteration: 6 | 13614364 | 13703264 | 13791660 | 13639728 | 25364 Iteration: 7 | 13639728 | 13729060 | 13817392 | 13665096 | 25368 Iteration: 8 | 13665096 | 13754476 | 13843424 | 13690596 | 25500 Iteration: 9 | 13690596 | 13779700 | 13868172 | 13716020 | 25424 -------------------------------------------------------------------- Memory lost in last iteration: 25424   ________________________ 5.0 + ezfind + 21055   Initial memory value: 3779176 Memory | before | draft | publish | after | delta -------------------------------------------------------------------- Iteration: 0 | 3779264 | 4066720 | 7714864 | 7574264 | 3795000 Iteration: 1 | 7574352 | 7662272 | 7740684 | 7599724 | 25372 Iteration: 2 | 7599724 | 7688188 | 7766864 | 7625220 | 25496 Iteration: 3 | 7625220 | 7714260 | 7792860 | 7650600 | 25380 Iteration: 4 | 7650600 | 7739484 | 7818256 | 7676084 | 25484 Iteration: 5 | 7676084 | 7764908 | 7843884 | 7701460 | 25376 Iteration: 6 | 7701460 | 7790412 | 7869196 | 7726812 | 25352 Iteration: 7 | 7726812 | 7816044 | 7895008 | 7752184 | 25372 Iteration: 8 | 7752184 | 7841572 | 7920700 | 7777696 | 25512 Iteration: 9 | 7777696 | 7866844 | 7945728 | 7803104 | 25408 -------------------------------------------------------------------- Memory lost in last iteration: 25408   ________________________ 5.0 + ezfind + 21055 + 20952   Initial memory value: 3779176 Memory | before | draft | publish | after | delta -------------------------------------------------------------------- Iteration: 0 | 3779264 | 4066720 | 7701300 | 7560664 | 3781400 Iteration: 1 | 7560752 | 7648692 | 7717668 | 7576712 | 15960 Iteration: 2 | 7576712 | 7665420 | 7734588 | 7592656 | 15944 Iteration: 3 | 7592656 | 7681364 | 7750596 | 7608608 | 15952 Iteration: 4 | 7608608 | 7697396 | 7766608 | 7624548 | 15940 Iteration: 5 | 7624548 | 7712928 | 7782388 | 7640512 | 15964 Iteration: 6 | 7640512 | 7729336 | 7798816 | 7656412 | 15900 Iteration: 7 | 7656412 | 7745760 | 7815216 | 7672340 | 15928 Iteration: 8 | 7672340 | 7761836 | 7831276 | 7688288 | 15948 Iteration: 9 | 7688288 | 7777988 | 7847788 | 7704272 | 15984 -------------------------------------------------------------------- Memory lost in last iteration: 15984 For info about the results without ezfind check: https://jira.ez.no/browse/EZP-21055?focusedCommentId=77698&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-77698
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

          Show
          Marcos Loureiro (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Paulo Bras (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Time Spent - 3 days, 30 minutes Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 days, 30 minutes Remaining Estimate - 1 hour
                3d 30m