MantisBT
Mantis Bug Tracker Workflow

View Revisions: Issue #29412 All Revisions ] Back to Issue ]
Summary 0029412: Huge Memory leak since I upgraded to OC 6.9.0
Revision 2018-01-13 08:49 by abv
Steps To Reproduce vtest command source code:
#include <AIS_Shape.hxx>
#include <gp_Circ.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <TopoDS_Wire.hxx>
static Standard_Integer VTest (Draw_Interpretor& /*theDI*/, Standard_Integer theArgNb, const char** 
theArgVec)
{
  Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
  if (aCtx.IsNull())
  {
    std::cout << "Error: no active view.\n";
    return 1;
  }

  const int aNbIters = 10000;
  int aProgressPrev = -1;
  for (int m_loopIndex = 0; m_loopIndex < aNbIters; m_loopIndex++)
  {
    gp_Pnt pos;
    gp_Vec dir(0, 0,1);

    gp_Ax2 center (pos, dir);
    gp_Circ circle (center, 1);
    Handle(AIS_Shape) feature;

    BRepBuilderAPI_MakeEdge builder( circle );

    if( builder.Error() == BRepBuilderAPI_EdgeDone )
    {
      TopoDS_Edge E1 = builder.Edge();
      TopoDS_Shape W2 = BRepBuilderAPI_MakeWire(E1).Wire();
      feature = new AIS_Shape(W2);
      aCtx->Display (feature, true);
    }

    aCtx->CurrentViewer()->Update();
    ViewerTest::CurrentView()->FitAll();
    aCtx->Remove (feature, true);

    const int aProgress = (m_loopIndex * 100) / aNbIters;
    if (aProgress != aProgressPrev)
    {
      std::cerr << aProgress << "%\r";
      aProgressPrev = aProgress;
    }
  }
  return 0;
}


Test script:
pload VISUALIZATION
vcaps -vsync 0
vinit View1
vglinfo
meminfo
vmemgpu
vtest
meminfo
vmemgpu 


Unmodified original test code:
void DrawcircleLoop()
{	
    for(int m_loopIndex = 0; m_loopIndex < 10000; m_loopIndex++)
    {
        gp_Pnt pos;
        gp_Vec dir(0, 0,1);

        gp_Ax2 center (pos, dir);
        gp_Circ circle (center, 1);
        Handle(AIS_Shape) feature;
        
        BRepBuilderAPI_MakeEdge builder( circle );
        
        if( builder.Error() == BRepBuilderAPI_EdgeDone )
        {
            TopoDS_Edge  E1 = builder.Edge();				
            TopoDS_Shape  W2 = BRepBuilderAPI_MakeWire(E1).Wire();					
            feature = new AIS_Shape(W2);
            myAISContext->Display(feature);		
        }
        
        myViewer->Update();	
        myV2dView->FitAll();
        myAISContext->Remove(feature);
    }
}
Revision 2018-01-07 15:54 by kgv
Steps To Reproduce vtest command source code:
#include <AIS_Shape.hxx>
#include <gp_Circ.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <TopoDS_Wire.hxx>
static Standard_Integer VTest (Draw_Interpretor& /*theDI*/, Standard_Integer theArgNb, const char** 
theArgVec)
{
  Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
  if (aCtx.IsNull())
  {
    std::cout << "Error: no active view.\n";
    return 1;
  }

  const int aNbIters = 10000;
  int aProgressPrev = -1;
  for (int m_loopIndex = 0; m_loopIndex < aNbIters; m_loopIndex++)
  {
    gp_Pnt pos;
    gp_Vec dir(0, 0,1);

    gp_Ax2 center (pos, dir);
    gp_Circ circle (center, 1);
    Handle(AIS_Shape) feature;

    BRepBuilderAPI_MakeEdge builder( circle );

    if( builder.Error() == BRepBuilderAPI_EdgeDone )
    {
      TopoDS_Edge E1 = builder.Edge();
      TopoDS_Shape W2 = BRepBuilderAPI_MakeWire(E1).Wire();
      feature = new AIS_Shape(W2);
      aCtx->Display (feature, true);
    }

    aCtx->CurrentViewer()->Update();
    ViewerTest::CurrentView()->FitAll();
    aCtx->Remove (feature, true);

    const int aProgress = (m_loopIndex * 100) / aNbIters;
    if (aProgress != aProgressPrev)
    {
      std::cerr << aProgress << "%\n";
      aProgressPrev = aProgress;
    }
  }
  return 0;
}


Test script:
pload VISUALIZATION
vcaps -vsync 0
vinit View1
vglinfo
meminfo
vmemgpu
vtest
meminfo
vmemgpu 


Unmodified original test code:
void DrawcircleLoop()
{	
    for(int m_loopIndex = 0; m_loopIndex < 10000; m_loopIndex++)
    {
        gp_Pnt pos;
        gp_Vec dir(0, 0,1);

        gp_Ax2 center (pos, dir);
        gp_Circ circle (center, 1);
        Handle(AIS_Shape) feature;
        
        BRepBuilderAPI_MakeEdge builder( circle );
        
        if( builder.Error() == BRepBuilderAPI_EdgeDone )
        {
            TopoDS_Edge  E1 = builder.Edge();				
            TopoDS_Shape  W2 = BRepBuilderAPI_MakeWire(E1).Wire();					
            feature = new AIS_Shape(W2);
            myAISContext->Display(feature);		
        }
        
        myViewer->Update();	
        myV2dView->FitAll();
        myAISContext->Remove(feature);
    }
}
Revision 2018-01-07 15:48 by kgv
Steps To Reproduce vtest command source code:
#include <AIS_Shape.hxx>
#include <gp_Circ.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>
#include <BRepBuilderAPI_MakeWire.hxx>
#include <TopoDS_Wire.hxx>
static Standard_Integer VTest (Draw_Interpretor& /*theDI*/, Standard_Integer theArgNb, const char** 
theArgVec)
{
  Handle(AIS_InteractiveContext) aCtx = ViewerTest::GetAISContext();
  if (aCtx.IsNull())
  {
    std::cout << "Error: no active view.\n";
    return 1;
  }

  const int aNbIters = 10000;
  int aProgressPrev = -1;
  for (int m_loopIndex = 0; m_loopIndex < aNbIters; m_loopIndex++)
  {
    gp_Pnt pos;
    gp_Vec dir(0, 0,1);

    gp_Ax2 center (pos, dir);
    gp_Circ circle (center, 1);
    Handle(AIS_Shape) feature;

    BRepBuilderAPI_MakeEdge builder( circle );

    if( builder.Error() == BRepBuilderAPI_EdgeDone )
    {
      TopoDS_Edge E1 = builder.Edge();
      TopoDS_Shape W2 = BRepBuilderAPI_MakeWire(E1).Wire();
      feature = new AIS_Shape(W2);
      aCtx->Display (feature, true);
    }

    aCtx->CurrentViewer()->Update();
    ViewerTest::CurrentView()->FitAll();
    aCtx->Remove (feature, true);

    const int aProgress = (m_loopIndex * 100) / aNbIters;
    if (aProgress != aProgressPrev)
    {
      std::cerr << aProgress << "%\n";
      aProgressPrev = aProgress;
    }
  }
  return 0;
}


Test script:
pload VISUALIZATION
vcaps -vsync 0
vinit View1
meminfo
vmemgpu 
vtest
meminfo
vmemgpu 


Unmodified original test code:
void DrawcircleLoop()
{	
    for(int m_loopIndex = 0; m_loopIndex < 10000; m_loopIndex++)
    {
        gp_Pnt pos;
        gp_Vec dir(0, 0,1);

        gp_Ax2 center (pos, dir);
        gp_Circ circle (center, 1);
        Handle(AIS_Shape) feature;
        
        BRepBuilderAPI_MakeEdge builder( circle );
        
        if( builder.Error() == BRepBuilderAPI_EdgeDone )
        {
            TopoDS_Edge  E1 = builder.Edge();				
            TopoDS_Shape  W2 = BRepBuilderAPI_MakeWire(E1).Wire();					
            feature = new AIS_Shape(W2);
            myAISContext->Display(feature);		
        }
        
        myViewer->Update();	
        myV2dView->FitAll();
        myAISContext->Remove(feature);
    }
}
Revision 2018-01-03 19:24 by uhammoud
Steps To Reproduce
void DrawcircleLoop()
{
    for(int m_loopIndex = 0; m_loopIndex < 10000; m_loopIndex++)
    {
        gp_Pnt pos;
        gp_Vec dir(0, 0,1);

        gp_Ax2 center (pos, dir);
        gp_Circ circle (center, 1);
        Handle(AIS_Shape) feature;
        
        BRepBuilderAPI_MakeEdge builder( circle );
        
        if( builder.Error() == BRepBuilderAPI_EdgeDone )
        {
            TopoDS_Edge E1 = builder.Edge();
            TopoDS_Shape W2 = BRepBuilderAPI_MakeWire(E1).Wire();
            feature = new AIS_Shape(W2);
            myAISContext->Display(feature);
        }
        
        myViewer->Update();
        myV2dView->FitAll();
        myAISContext->Remove(feature);
    }
}


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker