View Issue Details

IDProjectCategoryView StatusLast Update
0023818Open CASCADEOCCT:Foundation Classespublic2021-03-25 10:21
ReporterabvAssigned Toomy 
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Product Version6.6.0 
Target Version6.6.0Fixed in Version6.6.0 
Summary0023818: Extend OSD_MemInfo to report C heap statistics
DescriptionCurrently class OSD_MemInfo is able to report OS-specific memory allocation statistics such as working set, virtual memory etc. These parameters are very dependent on the OS state and thus not reliable for practical use, e.g. for control of memory leaks in automatic tests.

It is proposed to add functionality to report statistics on the status of the C heap, which should be more robust. In practice, current total amount of allocated memory should be sufficient.

On Windows with MSVCRT, functions heapwalk() can be used to parse through C heap.
On Linux with GLibC, function mallinfo() can be used (or even malloc_info() if it works).

Then we can add relevant option (e.g. "h" for heap) to DRAW command meminfo and try to use it instead of currently used option "w" in tests for memory leaks control.
TagsNo tags attached.
Test case numberNot needed

Relationships

parent of 0023901 closedomy Open CASCADE Memory leaks in tests 
parent of 0032006 newabv Open CASCADE Foundation Classes - OSD_MemInfo returns negative heap value 
related to 0023879 closeddbv Open CASCADE Test cases update for Mac OS X platform 
Not all the children of this issue are yet resolved or closed.

Activities

omy

2013-03-29 14:04

developer   ~0023935

Dear abv,
The fix was pushed to branch CR23818_1.
Please, review.

abv

2013-04-01 11:12

manager   ~0023947

What is a purpose of if at line 93 of OSD_MemInfo.cxx? Should not it just initialize the member by zero?

Please convert also other tests that use 'meminfo -w' now, to use of 'meminfo -h'

omy

2013-04-02 10:41

developer   ~0023961

Dear abv,
I've corrected the source code and the testcases.
Please, review branch CR23818_1.

abv

2013-04-04 06:56

manager   ~0023989

No remarks, please test

mkv

2013-04-05 17:42

tester   ~0024021

Dear BugMaster,

Branch CR23818_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested without rebase.
SHA-1: 8a49a808e0597127df45b74f96833b1914cdbbf0

Number of compiler warnings:

occt component :
Linux: 3 (3 on master)
Windows: 11 (11 on master)

products component :
Linux: 0 (0 on master)
Windows: 50 (50 on master)

New additional regressions/differences:
http://occt-tests/CR23818-1-master-occt/Mandriva2010/summary.html
http://occt-tests/CR23818-1-master-occt/Windows-32-VC9/summary.html
bugs caf(015) bug23489 - Memory leak detected
bugs moddata_2(012) bug277 - Memory leak detected

Improvements:
No improvements

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 239007532 / 238843232
Total CPU difference: 17035.890000000374 / 16287.660000000136

Testing on Windows:
Total MEMORY difference: 352178092 / 351722748
Total CPU difference: 21921.0625 / 20765.75

There are not serious differences in images found by testdiff.

abv

2013-04-10 08:51

manager   ~0024062

Oleg, please check the reported regressions -- are they really memory leaks? Start by checking the operation performed in the test case

Related Changesets

occt: master 67a1064e

2013-04-12 09:21:13

omy

Details Diff
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.
Affected Issues
0023818
mod - src/Draw/Draw_BasicCommands.cxx Diff File
mod - src/OSD/OSD_MemInfo.cxx Diff File
mod - src/OSD/OSD_MemInfo.hxx Diff File
mod - tests/bugs/begin Diff File
mod - tests/bugs/caf/buc60921 Diff File
mod - tests/bugs/caf/bug114 Diff File
mod - tests/bugs/caf/bug23489 Diff File
mod - tests/bugs/fclasses/bug22611 Diff File
mod - tests/bugs/fclasses/bug7287_1 Diff File
mod - tests/bugs/fclasses/bug7287_2 Diff File
mod - tests/bugs/fclasses/bug7287_3 Diff File
mod - tests/bugs/fclasses/bug7287_4 Diff File
mod - tests/bugs/fclasses/bug7287_5 Diff File
mod - tests/bugs/fclasses/bug7287_6 Diff File
mod - tests/bugs/moddata_1/bug145 Diff File
mod - tests/bugs/moddata_1/bug20627 Diff File
mod - tests/bugs/moddata_2/bug277 Diff File
mod - tests/bugs/moddata_3/bug162 Diff File
mod - tests/bugs/vis/bug172 Diff File
mod - tests/bugs/vis/bug5682 Diff File
mod - tests/bugs/vis/bug79 Diff File

Issue History

Date Modified Username Field Change
2013-03-05 17:22 abv New Issue
2013-03-05 17:22 abv Assigned To => abv
2013-03-05 17:22 abv Assigned To abv => omy
2013-03-05 17:22 abv Status new => assigned
2013-03-29 14:04 omy Note Added: 0023935
2013-03-29 14:04 omy Assigned To omy => abv
2013-03-29 14:04 omy Status assigned => resolved
2013-04-01 11:12 abv Note Added: 0023947
2013-04-01 11:12 abv Status resolved => assigned
2013-04-01 13:05 abv Assigned To abv => omy
2013-04-02 10:41 omy Note Added: 0023961
2013-04-02 10:41 omy Assigned To omy => abv
2013-04-02 10:41 omy Status assigned => resolved
2013-04-04 06:56 abv Note Added: 0023989
2013-04-04 06:56 abv Assigned To abv => bugmaster
2013-04-04 06:56 abv Status resolved => reviewed
2013-04-04 14:52 mkv Assigned To bugmaster => mkv
2013-04-05 13:54 dbv Relationship added related to 0023879
2013-04-05 17:42 mkv Note Added: 0024021
2013-04-05 17:43 mkv Test case number => Not needed
2013-04-05 17:43 mkv Assigned To mkv => abv
2013-04-05 17:43 mkv Status reviewed => feedback
2013-04-10 08:51 abv Note Added: 0024062
2013-04-10 08:51 abv Assigned To abv => omy
2013-04-10 08:51 abv Status feedback => assigned
2013-04-15 07:25 abv Relationship added parent of 0023901
2013-04-15 17:59 omy Changeset attached => occt master 67a1064e
2013-04-15 17:59 omy Status assigned => verified
2013-04-15 17:59 omy Resolution open => fixed
2013-04-23 13:35 aiv Status verified => closed
2013-04-29 15:24 aiv Fixed in Version => 6.6.0
2020-12-17 22:26 kgv Relationship added parent of 0032006