0027318: Memory is not released in Select3D_SensitiveSet when destroying AIS_Interact...
[occt.git] / tests / bugs / vis / bug27318
CommitLineData
4c0d97ac 1puts "========"
2puts "OCC27318"
3puts "========"
4puts ""
5##################################################################
6puts "Memory is not released in Select3D_SensitiveSet when destroying AIS_InteractiveContext without removing objects"
7##################################################################
8
9pload VISUALIZATION QAcommands
10
11# to measure initial memory correctly, open and close interactive context
12# to load FreeImage
13vinit
14vclose
15set aMemInit [meminfo h]
16puts "Initial mem: [expr $aMemInit / (1024 * 1024)] MiB ([expr $aMemInit])"
17
18# create a box and display it in each interactive context. The context is
19# the only instance that references to the box. Therefore, the box must be
20# removed completely after each context's closing
21for {set anIter 0} {$anIter < 300} {incr anIter} {
22 vinit
23 OCC27318
24 vclose
25}
26
27set aMemAfter [meminfo h]
28puts "Memory after closing interactive context several times: [expr $aMemAfter / (1024 * 1024)] MiB ([expr $aMemAfter])"
29
30set aRatio [expr $aMemAfter / double($aMemInit)]
31
32# check if the memory difference is greater than 5%
33if [expr $aRatio > 1.05] {
34 puts "Error : TEST FAILED"
35}