View Issue Details

IDProjectCategoryView StatusLast Update
0007726CommunityOCCT:Visualizationpublic2012-02-06 08:25
ReporterabvAssigned To 
PrioritynormalSeveritytrivial 
Status closedResolutionfixed 
OSAll 
Fixed in Version5.2.3 
Summary0007726: Forum 7411: Memory leak with the trihedron display
DescriptionThis bug has been reported by Open Source community user Hugues on the Forum,
and correction was suggested by Sangsu Lee, see thread 7411:

http://www.opencascade.org/org/forum/thread_7411

-------------------------
Hugues:

When I set a Z-buffered trihedron in a V3d_View object, memory
consumption(pretty huge) of the application grows and grows as the view is
rotated, translated, zoomed, etc.
Here's the source code I use to tell a V3d_View object to display a red
zbuffered trihedron :
//construct a V3d_View object ...
Handle_V3d_View view = ...;
view->TriedronDisplay (Aspect_TOTP_LEFT_LOWER,
Quantity_NOC_RED, 0.08, V3d_WIREFRAME);

---------------
Sangsu Lee:

Hello,
I also found that problem, and I believe I found a solution too.
I think it is caused by not deleting gldisplaylist used for displaying the triedron.

So, you can solve it by simply inserting one line after the end of using those
display list.

try the below one.

in OpenGl_triedron.c

..........
.............

glPopAttrib();

/* fleches au bout des axes (= cones de la couleur demandee) */
l = L - L/4. ; /* distance a l'origine */
rayon = L/30. ; /* rayon de la base du cone */
Angle = 2. * M_PI/ NbFacettes;

glDeleteLists(startList,4);//by LSS for memery leak bug
LightOff();

/*
* origine names
*/
......
......

-----------------------
Sangsu Lee:

To OCC developers,

I think this code can be improved.
If we make the display lists only when it is made at first or user redefine the
triedron, and just call the lists when redrawing, and destroy it in the
v3d_viewer's destructor, it would be more fast and efficient.

Currently, it is always recreated and deleted again and it is not so efficient.
Additional information
and documentation updates
Documentation remark, added by SAN 2005-02-07 11:58:11:

Changes:
Calling glDeleteLists() was added to call_zbuffer_triedron_redraw() method in
OpenGl_triedron.c:
...
glPopAttrib();

 /* fleches au bout des axes (= cones de la couleur demandee) */
 l = L - L/4. ; /* distance a l'origine */
 rayon = L/30. ; /* rayon de la base du cone */
 Angle = 2. * M_PI/ NbFacettes;

 glDeleteLists(startList, 4); //added

 LightOff();
...
TagsNo tags attached.
Test case number

Attached Files

  • OpenGl_triedron.zip (8,841 bytes)

Relationships

related to 0007928 closedbugmaster Forum 7411: Improved display lists management for the trihedron display 

Activities

2005-01-25 09:20

 

OpenGl_triedron.zip (8,841 bytes)

Issue History

Date Modified Username Field Change
2005-01-14 12:05 bugmaster Status closed => assigned
2005-01-14 12:05 bugmaster Resolution suspended => @0@
2005-01-14 12:05 bugmaster Assigned To bugmaster => san
2005-01-24 15:35 san Assigned To san => skt
2005-01-25 11:42 bugmaster Status assigned => resolved
2005-01-26 13:57 apv CC => apv, aki
2005-02-03 10:43 aki Status resolved => tested
2005-02-07 09:24 bugmaster Status tested => verified
2005-05-06 15:32 bugmaster Status verified => closed
2005-05-06 15:32 bugmaster Resolution @0@ => fixed
2011-08-02 11:24 bugmaster Category OCCT:VIZ => OCCT:Visualization
2011-12-01 11:18 szy Assigned To skt =>
2011-12-01 11:18 szy Description Updated
2011-12-01 11:18 szy Additional Information Updated
2012-02-06 08:25 abv Relationship added related to 0007928