Problem 861

Summary: Memory leak in G4VisManager
Product: Geant4 Reporter: Koichi Murakami <Koichi.Murakami>
Component: visualization/managementAssignee: John.Allison
Status: RESOLVED FIXED    
Severity: critical    
Priority: P1    
Version: 8.0   
Hardware: All   
OS: All   

Description Koichi Murakami 2006-04-20 02:11:17 CEST
Memory consumption will explode when executing '/vis/scene/add/trajectories' for
drawing trajectories.

I suspect that G4VisManager::CheckModel() could cause memory leak.

  965  void G4VisManager::CheckModel () {
  966    G4VModel* pModel = fpSceneHandler->GetModel();
  967    if (!pModel) {  // provide a null model.
  968      pModel = &fVisManagerNullModel;
  969      fpSceneHandler -> SetModel (pModel);
  970    }
* 971    Ensure modeling parameters are right for this view...
* 972    fVisManagerModelingParameters
* 973      = *(fpSceneHandler -> CreateModelingParameters ());
* 974    pModel->SetModelingParameters (&fVisManagerModelingParameters);
  975  }

This method will be called at every time of drawing an object.
SceneHandler::CreateModelingParameters() will create new object of
G4ModelingParameters, but the object seems not to be well managed.
Comment 1 John.Allison 2006-04-20 09:09:59 CEST
Thankyou!  Yes!  Must have been a bad day when I programmed that!  Will be fixed in the next
reference tag (for developers) and the next release, Geant4 version 8.1, plaaned for June 2006.
Comment 2 John.Allison 2006-04-24 03:03:59 CEST
Fixed in vis-V08-00-05 proposed for next reference tag and next release.