Provides Report on memory usage by the application. Please note, the HTML generated by this function is partial and comprises only the table of interest. Returns: None

Return TypeFunction nameArguments
voidReportMemoryUsage(hzChain&,bool,)

Declared in file: hzProcess.h
Defined in file : hzMemory.cpp

Function Logic:

0:START 1:items cms 2:unknown 3:items 4:items 5:items items items 6:unknown 7:unknown 8:items items items items items 9:items items 10:unknown 11:items 12:items items items 13:pms 14: No text

Function body:

void ReportMemoryUsage (hzChain& Z)bool bHtml, 
{
   //  Category: Diagnostics
   //  
   //  Provides Report on memory usage by the application.
   //  
   //  Please note, the HTML generated by this function is partial and comprises only the table of interest.
   //  
   //  Argument: Z The hzChain instance to receive the report
   //  Returns: None
   static  hzMeminfo   pms = _hzGlobal_Memstats ;      //  Previous/initial memory statistics
   hzMeminfo   cms ;               //  Current memory stats
   hzXDate     now ;               //  Current date and time
   uint32_t    total = 0;          //  Total memory usage
   now.SysDateTime() ;
   //  Take current snapshot
   cms = _hzGlobal_Memstats ;
   if (bHtml)
       Z.Printf("<p><center>Memory Report at %s</center></p>\n", *now) ;
   else
       Z.Printf("Memory Report at %s\n", *now) ;
   g_pSMAR_Str->Report(Z) ;    //  Used exclusively by hzString
   g_pSMAR_Inet->Report(Z) ;   //  Used by hzEmaddr, hzDomain and hzUrl
   g_pSMAR_Edo->Report(Z) ;    //  Used exclusively by hdbObjRepos to store EDOs
   //  If no heap, this is presented as collections on the LHS and string/chains on the RHS in one 'row'. If there is a heap we have string/chains on the top
   //  LHS, collections on the bottom LHS and the heap activity on the RHS
   if (s_Heap)
   {
       //  Two reports on LHS
       if (bHtml)
       {
           Z <<
           "<table width=\"1400\" slign=\"center\">\n<tr>\n <td valign=\"top\">\n <table width=\"750\" slign=\"center\">\n <tr>\n  <td>\n"
                           ;
           _report_objects(Z, cms, pms, total, bHtml) ;
           Z <<
           "  </td>\n </tr>\n </table>\n </td>\n <td width=\"15\"> </td>\n <td>\n <table width=\"550\" slign=\"center\">\n <tr>\n  <td>\n"
                           ;
           //  Heap on RHS
           _report_heap(Z, cms, pms, total, bHtml) ;
           Z <<
           "  </td>\n </tr>\n </table>\n </td>\n</tr>\n</table>\n"
                        ;
       }
       else
       {
           _report_objects(Z, cms, pms, total, bHtml) ;
           _report_heap(Z, cms, pms, total, bHtml) ;
       }
   }
   else
   {
       //  collection on LHS, string chans on RHS
       if (!bHtml)
           _report_objects(Z, cms, pms, total, bHtml) ;
       else
       {
           Z <<
           "<table width=\"1400\" slign=\"center\">\n<tr>\n <td valign=\"top\">\n"
                                      ;
           _report_objects(Z, cms, pms, total, bHtml) ;
           Z <<
           " </td>\n</tr>\n</table>\n"
                        ;
       }
   }
   pms = cms ;
}