protected double sumMemoryActuals(ComponentInstance ci, boolean isROM) {
   try {
     double total =
         isROM ? GetProperties.getROMActualInKB(ci, 0.0) : GetProperties.getRAMActualInKB(ci, 0.0);
     EList subcis = ci.getComponentInstances();
     for (Iterator it = subcis.iterator(); it.hasNext(); ) {
       ComponentInstance subci = (ComponentInstance) it.next();
       total += sumMemoryActuals(subci, isROM);
     }
     return total;
   } catch (PropertyDoesNotApplyToHolderException e) {
     /*
      * Callers are allowed to be sloppy and not care if the property
      * actually applies to the category of the component instance 'ci'
      */
     return 0.0;
   }
 }
 /**
  * check the load from components bound to the given memory The components can be threads or
  * higher level components.
  *
  * @param curMemory Component Instance of memory
  */
 protected void doMemoryLoad(
     ComponentInstance curMemory, String somName, EList boundComponents, boolean isROM) {
   double totalMemory = 0.0;
   UnitLiteral kbliteral = GetProperties.getKBUnitLiteral(curMemory);
   String resourceName = isROM ? "ROM" : "RAM";
   double Memorycapacity =
       isROM
           ? GetProperties.getROMCapacityInKB(curMemory, 0.0)
           : GetProperties.getRAMCapacityInKB(curMemory, 0.0);
   if (boundComponents.size() == 0 && Memorycapacity > 0) {
     errManager.infoSummary(
         curMemory,
         somName,
         "No application components bound to "
             + curMemory.getComponentInstancePath()
             + " with "
             + resourceName
             + " capacity "
             + GetProperties.toStringScaled(Memorycapacity, kbliteral));
     return;
   }
   if (Memorycapacity == 0) {
     errManager.errorSummary(
         curMemory,
         somName,
         "Memory "
             + curMemory.getComponentInstancePath()
             + " has no "
             + resourceName
             + " capacity but has bound components.");
   }
   logHeader(
       "\n\nDetailed Workload Report for memory "
           + curMemory.getComponentInstancePath()
           + " with Capacity "
           + GetProperties.toStringScaled(Memorycapacity, kbliteral)
           + "\n\nComponent,Budget,Actual");
   Set budgeted = new HashSet();
   for (Iterator it = boundComponents.iterator(); it.hasNext(); ) {
     String notes = "";
     ComponentInstance bci = (ComponentInstance) it.next();
     double totalactual = sumMemoryActuals(bci, isROM);
     double budget =
         isROM
             ? GetProperties.getROMBudgetInKB(bci, 0.0)
             : GetProperties.getRAMBudgetInKB(bci, 0.0);
     if (totalactual > 0) {
       // only compare if there were actuals
       if (totalactual > budget) {
         notes =
             notes
                 + ",Error: "
                 + resourceName
                 + " subtotal exceeds budget by "
                 + (totalactual - budget)
                 + " KB";
       } else if (totalactual < budget) {
         notes =
             notes
                 + ",Warning: "
                 + resourceName
                 + " Subtotal under budget by "
                 + (budget - totalactual)
                 + " KB";
       }
     }
     if (totalactual == 0.0) {
       // we use a budget number as there are no actuals
       if (budget > 0 && !budgeted.contains(bci)) {
         // only add it if no children budget numbers have been added
         totalMemory += budget;
         detailedLog(bci, budget, kbliteral);
         // add ancestors to budgeted list so their budget does not get added later
         while ((bci = bci.getContainingComponentInstance()) != null) {
           budgeted.add(bci);
         }
       }
     } else {
       // add only the current actual; the children actual have been added before
       double currentActual =
           isROM
               ? GetProperties.getROMActualInKB(bci, 0.0)
               : GetProperties.getRAMActualInKB(bci, 0.0);
       detailedLog(bci, budget, kbliteral);
       totalMemory += currentActual;
     }
   }
   if (Memorycapacity == 0)
     errManager.errorSummary(
         curMemory,
         somName,
         ""
             + (isROM ? "ROM" : "RAM")
             + " memory "
             + curMemory.getComponentInstancePath()
             + " has no memory capacity specified");
   if (totalMemory > Memorycapacity) {
     errManager.errorSummary(
         curMemory,
         somName,
         "Total Memory "
             + totalMemory
             + " KB of bounds tasks exceeds Memory capacity "
             + Memorycapacity
             + " KB of "
             + curMemory.getComponentInstancePath());
   } else if (totalMemory == 0.0 && Memorycapacity == 0.0) {
     errManager.warningSummary(
         curMemory,
         somName,
         ""
             + (isROM ? "ROM" : "RAM")
             + " memory "
             + curMemory.getComponentInstancePath()
             + " has no capacity. Bound app's have no memory budget.");
   } else {
     errManager.infoSummary(
         curMemory,
         somName,
         "Total "
             + (isROM ? "ROM" : "RAM")
             + " memory "
             + totalMemory
             + " KB of bound tasks within Memory capacity "
             + Memorycapacity
             + " KB of "
             + curMemory.getComponentInstancePath());
   }
 }