Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-1045

memory usage regression when many classes are defined

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.6.0
    • Component/s: Evaluation
    • Labels:
      None

      Description

      Reported in the ML from Loïc Pefferkorn. In summary, 3.5 needs less than 30 MB of heap memory for defining 400K classes, while 3.6 needs more than 200MB. For details see "Loic's blog post":http://www.loicp.eu/blog/cfengine_how_many_classes_can_be_defined.

      The offending code is in @ClassTablePut()@. Primarily setting tags with StringSetFromString(), and secondly the RBTreePut() function:

      <pre>
      cls = xmalloc(sizeof(Class));
      ClassInit(cls, ns, name, is_soft, scope);
      // NULL tags are OK (but you want to give good tags, don't you?)
      cls->tags = StringSetFromString(tags, ',');
      return RBTreePut(table->classes, (void *)cls->hash, cls);
      </pre>

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                a10038 jimis (Dimitrios Apostolou)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel