mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51:21 +03:00
0024264: OCCT 6.6.0: cutting 1600 cylinders from a box leads to out-of-memory on 32-bit system
Added test case (perf bop boxholes)
This commit is contained in:
parent
6699377892
commit
465d1a2c7e
71
tests/perf/bop/boxholes
Normal file
71
tests/perf/bop/boxholes
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
puts "========"
|
||||||
|
puts "CR24264"
|
||||||
|
puts "========"
|
||||||
|
puts ""
|
||||||
|
#######################################################################
|
||||||
|
# OCCT 6.6.0: cutting 1600 cylinders from a box leads to out-of-memory on 32-bit system
|
||||||
|
#######################################################################
|
||||||
|
|
||||||
|
# test cutting box by many holes, inspired by
|
||||||
|
# http://www.opencascade.org/org/forum/thread_12369/?forum=3
|
||||||
|
# in OCCT 6.6.0 32-bit mode on Windows this fails with N >= 40 (out of memory)
|
||||||
|
|
||||||
|
# box plate to cut the holes from
|
||||||
|
box b 100 100 1
|
||||||
|
|
||||||
|
# N defines number of holes along each of X and Y, thus total N^2 holes
|
||||||
|
# will be drilled; note that the algorithm iself is likely to be quadratic
|
||||||
|
# for number of shapes, i.e. CPU ~ N^4
|
||||||
|
set N 40
|
||||||
|
set holes {}
|
||||||
|
for {set i 1} {$i < $N} {incr i} {
|
||||||
|
for {set j 1} {$j < $N} {incr j} {
|
||||||
|
pcylinder p_${i}_$j 0.5 1
|
||||||
|
ttranslate p_${i}_$j [expr $i * 100. / $N] [expr $j * 100. / $N] 0.
|
||||||
|
lappend holes p_${i}_$j
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
eval compound $holes drill
|
||||||
|
|
||||||
|
set mem1 [meminfo h]
|
||||||
|
|
||||||
|
dchrono cpu reset
|
||||||
|
dchrono cpu start
|
||||||
|
|
||||||
|
bcut r b drill
|
||||||
|
|
||||||
|
dchrono cpu stop
|
||||||
|
puts [dchrono cpu show]
|
||||||
|
set q2 [dchrono cpu show]
|
||||||
|
|
||||||
|
set mem2 [meminfo h]
|
||||||
|
|
||||||
|
set mem1 [expr ${mem1}/(1024 * 1024)]
|
||||||
|
set mem2 [expr ${mem2}/(1024 * 1024)]
|
||||||
|
set mem_delta 70
|
||||||
|
puts "mem1=${mem1}"
|
||||||
|
puts "mem2=${mem2}"
|
||||||
|
puts "mem_delta=${mem_delta}"
|
||||||
|
|
||||||
|
if { [expr ${mem2} - ${mem1}] > ${mem_delta}} {
|
||||||
|
puts "Faulty : there is memory leak"
|
||||||
|
}
|
||||||
|
|
||||||
|
regexp {CPU user time: ([-0-9.+eE]+) seconds} ${q2} full z
|
||||||
|
if { [string compare $tcl_platform(platform) "windows"] == 0 } {
|
||||||
|
puts "OS = Windows NT"
|
||||||
|
set max_time 200
|
||||||
|
} else {
|
||||||
|
puts "OS = Linux"
|
||||||
|
set max_time 250
|
||||||
|
}
|
||||||
|
if { ${z} > ${max_time} } {
|
||||||
|
puts "Elapsed time is more than ${max_time} seconds - Faulty"
|
||||||
|
} else {
|
||||||
|
puts "Elapsed time is less than ${max_time} seconds - OK"
|
||||||
|
}
|
||||||
|
|
||||||
|
vinit
|
||||||
|
vdisplay r
|
||||||
|
vfit
|
@ -204,7 +204,4 @@ foreach s1 $surfaces {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# call vinit just to prepare for snapshot
|
#eval vdisplay $shapes; vfit
|
||||||
#eval vdisplay $shapes
|
|
||||||
vinit
|
|
||||||
fit
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
vdump $imagedir/${test_image}.png
|
if { "[vviewlist]" != "" } {
|
||||||
|
vdump $imagedir/${test_image}.png
|
||||||
|
}
|
||||||
|
|
||||||
puts "TEST COMPLETED"
|
puts "TEST COMPLETED"
|
||||||
|
@ -15,3 +15,4 @@
|
|||||||
015 single_object_shading
|
015 single_object_shading
|
||||||
016 single_object_wireframe
|
016 single_object_wireframe
|
||||||
017 bspline
|
017 bspline
|
||||||
|
018 bop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user