1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0023818: Extend OSD_MemInfo to report C heap statistics

A new counter MemHeapUsage was added to OSD_MemInfo class to examine program heap size
DRAW command meminfo got new option -h (--heap ) to use new counter data
The following testcases were changed to use new option -h of DRAW command meminfo
myCounters[MemHeapUsage] now will always be refilled every time the OSD_MemInfo::Update() function is called.
Fixed testcases to use meminfo -h instead of meminfo -w to detect memory leaks more properly.
This commit is contained in:
omy
2013-04-12 13:21:13 +04:00
parent 38da19bd28
commit 67a1064eb8
21 changed files with 81 additions and 48 deletions

View File

@@ -664,6 +664,10 @@ static int dmeminfo (Draw_Interpretor& theDI,
{
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemVirtual)) << " ";
}
else if (anArg == "heap" || anArg == "h")
{
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemHeapUsage)) << " ";
}
else if (anArg == "wset" || anArg == "w")
{
theDI << Standard_Real (aMemInfo.Value (OSD_MemInfo::MemWorkingSet)) << " ";
@@ -719,7 +723,7 @@ void Draw::BasicCommands(Draw_Interpretor& theCommands)
"debug memory allocation/deallocation, w/o args for help",
__FILE__, mallochook, g);
theCommands.Add ("meminfo",
"meminfo [virt|v] [wset|w] [wsetpeak] [swap] [swappeak] [private]"
"meminfo [virt|v] [heap|h] [wset|w] [wsetpeak] [swap] [swappeak] [private]"
" : memory counters for this process",
__FILE__, dmeminfo, g);