Support function to ReportMemoryUsage(). Provides Report on strings and chain memory usage by the application. Returns: None
| Return Type | Function name | Arguments |
|---|---|---|
| void | _report_objects | (hzChain&,hzMeminfo&,hzMeminfo&,uint32_t&,bool,) |
Declared and defined in file: hzMemory.cpp
Function Logic:
Function body:
void _report_objects (hzChain& Z)hzMeminfo& cms, hzMeminfo& pms, uint32_t& total, bool bHtml,
{
// Category: Diagnostics
//
// Support function to ReportMemoryUsage(). Provides Report on strings and chain memory usage by the application.
//
// Arguments: 1) Z The hzChain instance to receive the report
// 2) cms Current memory stats
// 3) pms Previous memory stats
// 4) total Running total RAM
//
// Returns: None
static int32_t prev_StrTbl = 0; // Previous count of strings held in string table
uint32_t U ; // Memory used by given object class
if (bHtml)
{
Z <<
"<table width=\"750\" align=\"center\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" style=\"text-decoration:none; font-family:verdana; font-size:11px; font-weight:normal; color:#000000;\">\n<tr>\n\t<th width=\"90\">Entity</th>\n\t<th width=\"90\">Assigned</th>\n\t<th width=\"90\">Prev</th>\n\t<th width=\"90\">Free</th>\n\t<th width=\"90\">Prev</th>\n\t<th width=\"90\">Total</th>\n\t<th width=\"90\">Prev</th>\n\t<th width=\"110\">Total RAM</th>\n</tr>\n"
;
}
else
{
Z << "Entity__________ Assigned_____ Prev_________ Free_________ Prev_________ Total________ Prev_________ Total RAM____\n" ;
}
// CHAINS
U = cms.m_numChain * sizeof(hzChain) ;
U += (cms.m_numChainDC * 32);
total += U ;
_report_mem_itemC(Z, "Chains..........",
cms.m_numChainDC, pms.m_numChainDC, cms.m_numChain - cms.m_numChainDC, pms.m_numChain - pms.m_numChainDC, cms.m_numChain, pms.m_numChain, U, bHtml) ;
// CHAIN BLOCKS. Note that count of allocated blocks is the total number of blocks created minus the count of those in the freelist
U = cms.m_numChainBlks * 1480;
total += U ;
_report_mem_itemC(Z, "Chain Blocks....",
cms.m_numChainBlks - cms.m_numChainBF, pms.m_numChainBlks - pms.m_numChainBF, cms.m_numChainBF, pms.m_numChainBF, cms.m_numChainBlks, pms.m_numChainBlks, U, bHtml) ;
if (bHtml)
{
Z <<
"</table>\n<table width=\"350\" align=\"center\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\" style=\"text-decoration:none; font-family:verdana; font-size:11px; font-weight:normal; color:#000000;\">\n<tr>\n\t<th width=\"90\">Entity</th>\n\t<th width=\"90\">Assigned</th>\n\t<th width=\"90\">Prev</th>\n\t<th width=\"90\">TOTAL RAM</th>\n\t<th width=\"90\"></th>\n</tr>\n"
;
}
else
{
Z << "__________________________________________________________________________________________________________________\n\n" ;
Z << "Entity__________ Assigned_____ Prev_________ Total RAM____\n" ;
}
// Fixed Strings
/*
** if (_hzGlobal_setStrings)
** {
** U = _hzGlobal_setStrings->Count() * sizeof(hzStrRepos) ;
** total += U ;
** _report_mem_itemA(Z, "Fix Str Repos :", _hzGlobal_setStrings->Count(), prev_StrTbl, U, bHtml) ;
**
** U = _hzGlobal_setStrings->Blocks() * 65536 ;
** total += U ;
** _report_mem_itemA(Z, "Fix Str Blocks :", _hzGlobal_setStrings->Blocks(), prev_StrTbl, U, bHtml) ;
** }
**
** _report_mem_itemA(Z, "Fixed Strings :", cms.m_numStrings, pms.m_numStrings, U, bHtml) ;
** */
// COLLECTIONS
U = cms.m_numLists * 8; total += U ; _report_mem_itemA(Z, "Lists :", cms.m_numLists, pms.m_numLists, U, bHtml) ;
U = cms.m_numListDC * 32; total += U ; _report_mem_itemA(Z, "Lists (active) :", cms.m_numListDC, pms.m_numListDC, U, bHtml) ;
U = cms.m_numSmaps * 64; total += U ; _report_mem_itemA(Z, "Maps(S) :", cms.m_numSmaps, pms.m_numSmaps, U, bHtml) ;
U = cms.m_numMmaps * 64; total += U ; _report_mem_itemA(Z, "Maps(M) :", cms.m_numMmaps, pms.m_numMmaps, U, bHtml) ;
U = cms.m_numSets * 64; total += U ; _report_mem_itemA(Z, "Sets :", cms.m_numSets, pms.m_numSets, U, bHtml) ;
U = cms.m_numArrays * 64; total += U ; _report_mem_itemA(Z, "Arrays :", cms.m_numArrays, pms.m_numArrays, U, bHtml) ;
U = cms.m_numVectors * 64; total += U ; _report_mem_itemA(Z, "Vectors :", cms.m_numVectors, pms.m_numVectors, U, bHtml) ;
U = cms.m_numIsams * 64; total += U ; _report_mem_itemA(Z, "ISAMS :", cms.m_numIsams, pms.m_numIsams, U, bHtml) ;
U = cms.m_numIsamIndx * 64; total += U ; _report_mem_itemA(Z, "ISAM Blk Index :", cms.m_numIsamIndx, pms.m_numIsamIndx, U, bHtml) ;
U = cms.m_numIsamData * 64; total += U ; _report_mem_itemA(Z, "ISAM Blk Data :", cms.m_numIsamData, pms.m_numIsamData, U, bHtml) ;
U = cms.m_numBitmaps * 64; total += U ; _report_mem_itemA(Z, "Bitmaps :", cms.m_numBitmaps, pms.m_numBitmaps, U, bHtml) ;
U = cms.m_numBitmapSB * 64; total += U ; _report_mem_itemA(Z, "Bitmap Segments:", cms.m_numBitmapSB, pms.m_numBitmapSB, U, bHtml) ;
U = cms.m_numDochtm * 64; total += U ; _report_mem_itemA(Z, "Doc HTML :", cms.m_numDochtm, pms.m_numDochtm, U, bHtml) ;
U = cms.m_numDocxml * 64; total += U ; _report_mem_itemA(Z, "Doc XML :", cms.m_numDocxml, pms.m_numDocxml, U, bHtml) ;
U = cms.m_numBincron * 64; total += U ; _report_mem_itemA(Z, "BinCrons :", cms.m_numBincron, pms.m_numBincron, U, bHtml) ;
U = cms.m_numBinstore * 64; total += U ; _report_mem_itemA(Z, "BinStores :", cms.m_numBinstore, pms.m_numBinstore, U, bHtml) ;
// TOTAL
if (bHtml)
{
Z << "<tr><td>TOTAL EST:</td><td></td><td></td><td></td><td></td><td></td><td></td>" ;
Z.Printf("<td align=\"right\">%s</td></tr>\n", _snh(total)) ;
Z << "</table>\n\n" ;
}
else
{
Z << "__________________________________________________________\n" ;
Z.Printf("TOTAL EST: %s\n", _snt(total)) ;
}
ReportStringAllocations(Z, bHtml) ;
}