View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002499 | Community | OCCT:Foundation Classes | public | 2003-04-28 15:24 | 2011-11-29 10:57 |
Reporter | bugmaster | Assigned To | szy | ||
Priority | normal | Severity | trivial | ||
Status | closed | Resolution | fixed | ||
OS | All | ||||
Fixed in Version | 5.1.0 | ||||
Summary | 0002499: The assignation operator for all the maps assignation is bugged | ||||
Description | Bug from Open CASCADE community Autors: Joel Donneux & Ivan Fontaine http://www.opencascade.org/forumorg/bug.php?bug_id=118&f=8 Well, a new candidate for the "Bug of Year" contest. The assignation operator for all the maps assignation is bugged. The destination map is resized using the number of buckets of the map. The result of this is that during an assignation all the destination maps are sized to the "NextPrime" size. If you have a map with one element and if you copy it 26 times, you end up with a map having 100019 buckets to store one element. And if your application has some map of maps and that you use CAF, you can potentially use hundreds of mega bytes to store a few Standard_Integer !! Needless to say, Cascade is rather memory hungry, and this bug makes the situation even worst. You should alter all your maps definitions in a way like this: TCollection_Map& TCollection_Map::Assign(const TCollection_Map& Other) { if (this == &Other) return *this; Clear(); // **** modif // ReSize() uses the TCollection::NextPrimeForMap() to get the next bucket size, // so, the bucket size grows at each copy, even in the number of object // in the map is constant ! // // ReSize(Other.NbBuckets()); // if (!Other.IsEmpty()) { ReSize(Other.Extent()); // **** END modif for (TCollection_MapIterator It(Other); It.More(); It.Next()) { Add(It.Key()); } } return *this; } Joel Donneux & Ivan Fontaine | ||||
Tags | No tags attached. | ||||
Test case number | |||||
Date Modified | Username | Field | Change |
---|---|---|---|
2003-04-28 15:25 | bugmaster | Assigned To | bugmaster => szy |
2003-04-28 15:25 | bugmaster | Status | new => assigned |
2003-04-28 15:25 | bugmaster | Summary | => The assignation operator for all the maps assignation is bugged |
2003-05-12 19:46 | bugmaster | Status | assigned => resolved |
2003-05-15 20:19 |
|
CC | => apv |
2003-05-15 20:20 |
|
CC | => aki |
2003-05-23 22:18 |
|
Status | resolved => tested |
2003-06-02 12:13 | bugmaster | Status | tested => closed |
2003-06-02 12:13 | bugmaster | Resolution | @0@ => fixed |
2004-12-30 11:32 | bugmaster | Customer | => |
2011-08-02 11:23 | bugmaster | Category | OCCT:FDC => OCCT:Foundation Classes |
2011-11-29 10:57 | bugmaster | Description Updated |