bf954475 |
1 | puts "========" |
2 | puts "OCC27604" |
3 | puts "Application Framework - memory is not released after closing XBF file" |
4 | puts "========" |
5 | puts "" |
6 | |
7 | set aBigShape Bottom.brep |
8 | |
9 | pload OCAF MODELING |
10 | |
11 | # just a big shape to fit in memory |
12 | restore [locate_data_file $aBigShape] s |
13 | |
1dd28279 |
14 | file delete ${imagedir}/test.cbf |
15 | |
bf954475 |
16 | # store it in the document |
17 | NewDocument D BinOcaf |
18 | SetShape D "0:2" s |
1dd28279 |
19 | SaveAs D ${imagedir}/test.cbf |
bf954475 |
20 | Close D |
21 | |
22 | # store the memory used before opening a document |
23 | set aBefore [meminfo h] |
24 | |
1dd28279 |
25 | Open ${imagedir}/test.cbf DD |
bf954475 |
26 | set aDocLoaded [meminfo h] |
27 | set aBigDelta [expr $aDocLoaded - $aBefore] |
28 | Close DD |
29 | |
30 | set anAfter [meminfo h] |
31 | set aDelta [expr $anAfter - $aBefore] |
32 | |
33 | puts "Memory used before: $aBefore" |
34 | puts "After open: $aDocLoaded" |
35 | puts "After close: $anAfter" |
36 | |
37 | # if after the close the memory used left 5% more than before closed, this is an issue |
38 | # (less 5% is the measurement tolerance) |
39 | if {[expr $aBigDelta / 20. - $aDelta] < 0} { |
40 | puts "Error: the memory is not freed after Open/Close" |
41 | } |