• Icon: Bug Report Bug Report
    • Resolution: Cannot Reproduce
    • Icon: L3 - Default L3 - Default
    • None
    • None
    • engine
    • None

      Environment (Required on creation):

      Camunda 7.14.0

      Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

       

      We got huge memory usage on our production and after the heap dump analyzing we got that most of memory is used by camunda and expecially by DbEntityManager class.

       

       

      Steps to reproduce (Required on creation):

      Run big number of process instances with full history level

      Observed Behavior (Required on creation):

      Huge memory usage

      Expected behavior (Required on creation):

       

      No memory leacks 

      Root Cause (Required on prioritization):

      See description 

      Solution Ideas (Optional):

       

      Store in cache only these objects camunda won't work without 

      Hints (optional):

        This is the controller panel for Smart Panels app

            [CAM-14751] Huge memory usage DbEntityManager

            Alexander Pankratiev created issue -
            Alexander Pankratiev made changes -
            Component/s New: engine [ 11656 ]
            Alexander Pankratiev made changes -
            Description Original: h3. Environment (Required on creation):
            h3. Camunda 7.14.0
            h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

             

            We got huge memory usage on our production and after the heap dump analyzing we got that most of memory is used by camunda and expecially by DbEntityManager class.

            We've tried to investigate the source code and saw that any insert puts Cached entity to the cache 

             

            public void insert(DbEntity dbEntity) {
            // generate Id if not present
            ensureHasId(dbEntity);

            validateId(dbEntity);

            // put into cache
            dbEntityCache.putTransient(dbEntity);

            }

             

            It causes huge memory usage when there are a lot of process instances, history events, etc 
            h3. Steps to reproduce (Required on creation):

            Run big number of process instances with full history level 
            h3. Observed Behavior (Required on creation):


            Huge memory usage
            h3. Expected behavior (Required on creation):

             

            No memory leacks 
            h3. Root Cause (Required on prioritization):


            See description 
            h3. Solution Ideas (Optional):

             

            Constraint cache size
            h3. Hints (optional):
            New: h3. Environment (Required on creation):
            h3. Camunda 7.14.0
            h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

             

            We got huge memory usage on our production and after the heap dump analyzing we got that most of memory is used by camunda and expecially by DbEntityManager class.

            We've tried to investigate the source code and saw that any insert puts Cached entity to the cache 

             

             
            {code:java}
            public void insert(DbEntity dbEntity)
            {
            // generate Id if not present ensureHasId(dbEntity);
            validateId(dbEntity);
            // put into cache
            dbEntityCache.putTransient(dbEntity);
            }
             
            {code}
             

            It causes huge memory usage when there are a lot of process instances, history events, etc 
            h3. Steps to reproduce (Required on creation):

            Run big number of process instances with full history level 
            h3. Observed Behavior (Required on creation):

            Huge memory usage
            h3. Expected behavior (Required on creation):

             

            No memory leacks 
            h3. Root Cause (Required on prioritization):

            See description 
            h3. Solution Ideas (Optional):

             

            Constraint cache size
            h3. Hints (optional):
            Alexander Pankratiev made changes -
            Attachment New: image-2022-07-06-11-31-48-887.png [ 53065 ]
            Description Original: h3. Environment (Required on creation):
            h3. Camunda 7.14.0
            h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

             

            We got huge memory usage on our production and after the heap dump analyzing we got that most of memory is used by camunda and expecially by DbEntityManager class.

            We've tried to investigate the source code and saw that any insert puts Cached entity to the cache 

             

             
            {code:java}
            public void insert(DbEntity dbEntity)
            {
            // generate Id if not present ensureHasId(dbEntity);
            validateId(dbEntity);
            // put into cache
            dbEntityCache.putTransient(dbEntity);
            }
             
            {code}
             

            It causes huge memory usage when there are a lot of process instances, history events, etc 
            h3. Steps to reproduce (Required on creation):

            Run big number of process instances with full history level 
            h3. Observed Behavior (Required on creation):

            Huge memory usage
            h3. Expected behavior (Required on creation):

             

            No memory leacks 
            h3. Root Cause (Required on prioritization):

            See description 
            h3. Solution Ideas (Optional):

             

            Constraint cache size
            h3. Hints (optional):
            New: h3. Environment (Required on creation):
            h3. Camunda 7.14.0
            h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

             

            We got huge memory usage on our production and after the heap dump analyzing we got that most of memory is used by camunda and expecially by DbEntityManager class.

             

            !image-2022-07-06-11-31-48-887.png!

            We've tried to investigate the source code and saw that any insert puts Cached entity to the cache 

             

             
            {code:java}
            public void insert(DbEntity dbEntity)
            {
            // generate Id if not present ensureHasId(dbEntity);
            validateId(dbEntity);
            // put into cache
            dbEntityCache.putTransient(dbEntity);
            }
             
            {code}
             

            It causes huge memory usage when there are a lot of process instances, history events, etc 
            h3. Steps to reproduce (Required on creation):

            Run big number of process instances with full history level 
            h3. Observed Behavior (Required on creation):

            Huge memory usage
            h3. Expected behavior (Required on creation):

             

            No memory leacks 
            h3. Root Cause (Required on prioritization):

            See description 
            h3. Solution Ideas (Optional):

             

            Constraint cache size
            h3. Hints (optional):
            Alexander Pankratiev made changes -
            Description Original: h3. Environment (Required on creation):
            h3. Camunda 7.14.0
            h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

             

            We got huge memory usage on our production and after the heap dump analyzing we got that most of memory is used by camunda and expecially by DbEntityManager class.

             

            !image-2022-07-06-11-31-48-887.png!

            We've tried to investigate the source code and saw that any insert puts Cached entity to the cache 

             

             
            {code:java}
            public void insert(DbEntity dbEntity)
            {
            // generate Id if not present ensureHasId(dbEntity);
            validateId(dbEntity);
            // put into cache
            dbEntityCache.putTransient(dbEntity);
            }
             
            {code}
             

            It causes huge memory usage when there are a lot of process instances, history events, etc 
            h3. Steps to reproduce (Required on creation):

            Run big number of process instances with full history level 
            h3. Observed Behavior (Required on creation):

            Huge memory usage
            h3. Expected behavior (Required on creation):

             

            No memory leacks 
            h3. Root Cause (Required on prioritization):

            See description 
            h3. Solution Ideas (Optional):

             

            Constraint cache size
            h3. Hints (optional):
            New: h3. Environment (Required on creation):
            h3. Camunda 7.14.0
            h3. Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket):

             

            We got huge memory usage on our production and after the heap dump analyzing we got that most of memory is used by camunda and expecially by DbEntityManager class.

             

            !image-2022-07-06-11-31-48-887.png!

             
            h3. Steps to reproduce (Required on creation):

            Run big number of process instances with full history level
            h3. Observed Behavior (Required on creation):

            Huge memory usage
            h3. Expected behavior (Required on creation):

             

            No memory leacks 
            h3. Root Cause (Required on prioritization):

            See description 
            h3. Solution Ideas (Optional):

             

            Store in cache only these objects camunda won't work without 
            h3. Hints (optional):
            Summary Original: Memory leak in DbEntityManager New: Huge memory usage DbEntityManager

            Hi,

            Please provide a proper analysis of the memory issue that you are observing. What is currently missing:

            • Numbers: What is the heap size you are running the application with? How does the heap size develop over time?
            • Analysis: Why do you think this is caused by Camunda? What code causes this?

            I'm sorry that we can't do memory analysis for you. If you can point us to a specific problem in our code, we are happy to fix it.

            Please note that the DbEntityManger and DbEntityCache objects only live for as long as an (API) command runs. Once a command completes, the entity manager and cache are dereferenced and garbage-collected. If however that command loads a lot of data (e.g. because it makes a query with many results), then you may see an increase in memory consumption while that command runs. Also, if the command never returns (e.g. in the case of an infinite loop in the process), then the memory will also not be freed up.

            Cheers,
            Thorben

            Thorben Lindhauer added a comment - Hi, Please provide a proper analysis of the memory issue that you are observing. What is currently missing: Numbers: What is the heap size you are running the application with? How does the heap size develop over time? Analysis: Why do you think this is caused by Camunda? What code causes this? I'm sorry that we can't do memory analysis for you. If you can point us to a specific problem in our code, we are happy to fix it. Please note that the DbEntityManger and DbEntityCache objects only live for as long as an (API) command runs. Once a command completes, the entity manager and cache are dereferenced and garbage-collected. If however that command loads a lot of data (e.g. because it makes a query with many results), then you may see an increase in memory consumption while that command runs. Also, if the command never returns (e.g. in the case of an infinite loop in the process), then the memory will also not be freed up. Cheers, Thorben
            Thorben Lindhauer made changes -
            Resolution New: Cannot Reproduce [ 5 ]
            Status Original: Open [ 1 ] New: Closed [ 6 ]

              Unassigned Unassigned
              a.pankratiev Alexander Pankratiev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: