5 #######################################################################
6 # OCCT 6.6.0: cutting 1600 cylinders from a box leads to out-of-memory on 32-bit system
7 #######################################################################
9 # test cutting box by many holes, inspired by
10 # http://www.opencascade.org/org/forum/thread_12369/?forum=3
11 # in OCCT 6.6.0 32-bit mode on Windows this fails with N >= 40 (out of memory)
13 if { [regexp {Debug mode} [dversion]] } {
21 # box plate to cut the holes from
24 # N defines number of holes along each of X and Y, thus total N^2 holes
25 # will be drilled; note that the algorithm iself is likely to be quadratic
26 # for number of shapes, i.e. CPU ~ N^4
29 for {set i 1} {$i < $N} {incr i} {
30 for {set j 1} {$j < $N} {incr j} {
31 pcylinder p_${i}_$j 0.5 1
32 ttranslate p_${i}_$j [expr $i * 100. / $N] [expr $j * 100. / $N] 0.
33 lappend holes p_${i}_$j
37 eval compound $holes drill
47 puts [dchrono cpu show]
48 set q2 [dchrono cpu show]
52 set mem1 [expr ${mem1}/(1024 * 1024)]
53 set mem2 [expr ${mem2}/(1024 * 1024)]
57 puts "mem_delta=${mem_delta}"
59 if { [expr ${mem2} - ${mem1}] > ${mem_delta}} {
60 puts "Faulty : there is memory leak"
63 regexp {CPU user time: ([-0-9.+eE]+) seconds} ${q2} full z
64 if { ${z} > ${max_time} } {
65 puts "Elapsed time is more than ${max_time} seconds - Faulty"
67 puts "Elapsed time is less than ${max_time} seconds - OK"