MantisBT - Open CASCADE
View Issue Details
0032552Open CASCADE[OCCT] OCCT:Modeling Algorithmspublic2021-09-01 18:332021-09-20 17:31
asuraven 
smoskvin 
normalminor 
verifiedfixed 
 
[OCCT] 7.6.0* 
not required
0032552: Modeling Algorithms - BRepExtrema_DistShapeShape algorithm consumes too much memory
When calculating the distance by the distmini command the BRepExtrema_DistShapeShape algorithm consumes too much memory on big models
pload ALL
# ~60MB model
restore [locate_data_file 5000-12.brep] s1
# ~35MB model
restore [locate_data_file BPLSEITLI-12.brep] s2
# process memory increases up to 2.9 GB
distmini res s1 s2
No tags attached.
related to 0032539assigned asuraven Modeling Algorithms - Parallelize BRepExtrema_DistShapeShape algorithm 
Issue History
2021-09-01 18:33asuravenNew Issue
2021-09-01 18:33asuravenAssigned To => asuraven
2021-09-01 18:34asuravenNote Added: 0103643
2021-09-01 18:34asuravenStatusnew => assigned
2021-09-01 18:35asuravenRelationship addedrelated to 0032539
2021-09-02 13:59gitNote Added: 0103674
2021-09-02 14:08asuravenFile Added: CR32552 compare.xlsx
2021-09-02 14:10asuravenFile Deleted: CR32552 compare.xlsx
2021-09-02 21:34asuravenNote Added: 0103696
2021-09-07 16:56gitNote Added: 0103898
2021-09-10 14:46gitNote Added: 0103982
2021-09-10 14:46asuravenNote Added: 0103983
2021-09-10 21:05gitNote Added: 0103996
2021-09-13 12:26gitNote Added: 0104059
2021-09-14 19:34asuravenNote Added: 0104081
2021-09-14 19:35asuravenTest case number => not required
2021-09-14 19:35asuravenNote Added: 0104082
2021-09-14 19:35asuravenAssigned Toasuraven => msv
2021-09-14 19:35asuravenStatusassigned => resolved
2021-09-14 19:51msvNote Added: 0104083
2021-09-14 20:02msvNote Added: 0104084
2021-09-14 20:02msvAssigned Tomsv => asuraven
2021-09-14 20:02msvStatusresolved => assigned
2021-09-15 19:19gitNote Added: 0104102
2021-09-16 11:31gitNote Added: 0104116
2021-09-16 18:57asuravenNote Added: 0104130
2021-09-17 11:23gitNote Added: 0104138
2021-09-17 11:26gitNote Added: 0104139
2021-09-17 11:27asuravenNote Added: 0104140
2021-09-17 11:27asuravenAssigned Toasuraven => msv
2021-09-17 11:27asuravenStatusassigned => resolved
2021-09-17 13:59asuravenNote Added: 0104146
2021-09-17 15:06msvNote Added: 0104148
2021-09-17 15:07msvNote Added: 0104149
2021-09-17 15:07msvAssigned Tomsv => asuraven
2021-09-17 15:07msvStatusresolved => assigned
2021-09-17 15:35gitNote Added: 0104150
2021-09-17 15:36asuravenNote Added: 0104151
2021-09-17 15:36asuravenAssigned Toasuraven => msv
2021-09-17 15:36asuravenStatusassigned => resolved
2021-09-17 17:17gitNote Added: 0104163
2021-09-17 17:20msvNote Added: 0104165
2021-09-17 17:20msvAssigned Tomsv => bugmaster
2021-09-17 17:20msvStatusresolved => reviewed
2021-09-17 17:27kgvNote Added: 0104166
2021-09-17 17:36gitNote Added: 0104167
2021-09-17 17:37asuravenNote Added: 0104168
2021-09-18 09:37bugmasterStatusreviewed => tested
2021-09-18 09:37bugmasterNote Added: 0104177
2021-09-18 09:43smoskvinChangeset attached => occt master 92c1f972
2021-09-18 09:43smoskvinAssigned Tobugmaster => smoskvin
2021-09-18 09:43smoskvinStatustested => verified
2021-09-18 09:43smoskvinResolutionopen => fixed
2021-09-18 09:54gitNote Added: 0104211
2021-09-20 17:06asuravenFile Added: bug32539_1.7z
2021-09-20 17:09asuravenTest case numbernot required => perf\modalg\bug32539_1 perf\modalg\bug32539_2
2021-09-20 17:09asuravenNote Added: 0104235
2021-09-20 17:31asuravenFile Deleted: bug32539_1.7z
2021-09-20 17:31asuravenTest case numberperf\modalg\bug32539_1 perf\modalg\bug32539_2 => not required

Notes
(0103643)
asuraven   
2021-09-01 18:34   
(0103674)
git   
2021-09-02 13:59   
Branch CR32552 has been created by asuraven.

SHA-1: 7356559452aca4adb99cf853837d89131b0e1bad


Detailed log of new commits:

Author: asuraven
Date: Thu Sep 2 13:59:04 2021 +0300

    0032552: Modeling Algorithms - BRepExtrema_DistShapeShape algorithm consumes too much memory
    
    Used a new BRepExtrema_DistShapeShape::DistanceVertVert() function to replace DistanceMapMap() to calculate vertex/vertex distance
(0103696)
asuraven   
2021-09-02 21:34   
(0103898)
git   
2021-09-07 16:56   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: 0842b06db708b23c29e9a24c066868f4b36647c2
(0103982)
git   
2021-09-10 14:46   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: f317dcfdc963c3689eed0a3716996b38d6335e8c
(0103983)
asuraven   
2021-09-10 14:46   
(0103996)
git   
2021-09-10 21:05   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: 0905d8c5f29c5d4c505982ce5bc20770d7b4e070
(0104059)
git   
2021-09-13 12:26   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: bb3b8b560db204bb03a4be976a98dc4e4d729861
(0104081)
asuraven   
2021-09-14 19:34   
(0104082)
asuraven   
2021-09-14 19:35   
tests result:
http://jenkins-test-occt.nnov.opencascade.com/view/CR32552-master-ASURAVEN/view/COMPARE/ [^]
(0104083)
msv   
2021-09-14 19:51   
Please check if the following change in image is not caused by your changes:

IMAGE pmivis import nist_ct_06_inch: nist_ct_06_inch.png differs [2663 different pixels]
(0104084)
msv   
2021-09-14 20:02   
  NCollection_Vector<BRepExtrema_CheckPair> aPairList;

This variable is not used.

    for (Standard_Integer anIdx2 = 1; anIdx2 <= aCount2; ++anIdx2)
    {
      TopoDS_Vertex aVertex1 = TopoDS::Vertex(theMap1.FindKey(anIdx1));
      TopoDS_Vertex aVertex2 = TopoDS::Vertex(theMap2.FindKey(anIdx2));

      const gp_Pnt aPoint1 = BRep_Tool::Pnt(aVertex1);
      const gp_Pnt aPoint2 = BRep_Tool::Pnt(aVertex2);

The definitions of aVertex1, aPoint1 must be moved out of inner loop.
(0104102)
git   
2021-09-15 19:19   
Branch CR32552_1 has been created by asuraven.

SHA-1: 472d689579bc44a4376b6478a1ec1adabf9f980c


Detailed log of new commits:

Author: asuraven
Date: Wed Sep 15 19:19:27 2021 +0300

    0032552: for test branch
(0104116)
git   
2021-09-16 11:31   
Branch CR32552_1 has been updated forcibly by asuraven.

SHA-1: 8cdf10700fcf039e56a0659aeaf85efe1b388471
(0104130)
asuraven   
2021-09-16 18:57   
(0104138)
git   
2021-09-17 11:23   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: f386861fbf4b136226d4e49e481ca614d3c707d9
(0104139)
git   
2021-09-17 11:26   
Branch CR32552_1 has been deleted by asuraven.

SHA-1: 8cdf10700fcf039e56a0659aeaf85efe1b388471
(0104140)
asuraven   
2021-09-17 11:27   
remarks fixed
tests are running again now
(0104146)
asuraven   
2021-09-17 13:59   
tests results for branch CR32552 are here:
http://jenkins-test-occt.nnov.opencascade.com/view/CR32552-master-ASURAVEN/view/COMPARE/ [^]
(0104148)
msv   
2021-09-17 15:06   
    TopoDS_Vertex aVertex1 = TopoDS::Vertex(theMap1.FindKey(anIdx1));
...
      TopoDS_Vertex aVertex2 = TopoDS::Vertex(theMap2.FindKey(anIdx2));

TopoDS::Vertex returns reference, so use const& to avoid copying shapes.
(0104149)
msv   
2021-09-17 15:07   
I think this simple change won't need testing.
(0104150)
git   
2021-09-17 15:35   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: 283668f02b61348795f977f13c8fa04d1d28ed76
(0104151)
asuraven   
2021-09-17 15:36   
fixed
(0104163)
git   
2021-09-17 17:17   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: 136238157f55cde882f7e225976e1bba52771c9a
(0104165)
msv   
2021-09-17 17:20   
For integration:
occt - CR32552
products - none
(0104166)
kgv   
2021-09-17 17:27   

+  Standard_Boolean DistanceVertVert(const TopTools_IndexedMapOfShape& theMap1,
+                                    const TopTools_IndexedMapOfShape& theMap2,

It would be nice having some description of the method (not sure that name is self-explanatory here)...
(0104167)
git   
2021-09-17 17:36   
Branch CR32552 has been updated forcibly by asuraven.

SHA-1: b6f0ea1774255228514fd745336245a5e1f1835a
(0104168)
asuraven   
2021-09-17 17:37   
Comment added
(0104177)
bugmaster   
2021-09-18 09:37   
Combination -
OCCT branch : IR-2021-09-17
master SHA - 812ee2c9bec89902de2ff85201cb314e0de894cc
49e51745631c52b6c452c65adae4d6dfa21a1b1e
Products branch : IR-2021-09-17 SHA - 1127e31e32f90ff63544b0516092694f1a36932f
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17390.540000000547 / 17358.370000000414 [+0.19%]
Products
Total CPU difference: 11364.740000000118 / 11411.36000000011 [-0.41%]
Windows-64-VC14:
OCCT
Total CPU difference: 19321.5625 / 19327.15625 [-0.03%]
Products
Total CPU difference: 12746.171875 / 12747.78125 [-0.01%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0104211)
git   
2021-09-18 09:54   
Branch CR32552 has been deleted by mnt.

SHA-1: b6f0ea1774255228514fd745336245a5e1f1835a
(0104235)
asuraven   
2021-09-20 17:09