Problem 861 - Memory leak in G4VisManager
Summary: Memory leak in G4VisManager
Status: RESOLVED FIXED
Alias: None
Product: Geant4
Classification: Unclassified
Component: visualization/management (show other problems)
Version: 8.0
Hardware: All All
: P1 critical
Assignee: John.Allison
URL:
Depends on:
Blocks:
 
Reported: 2006-04-20 02:11 CEST by Koichi Murakami
Modified: 2006-04-24 03:03 CEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this problem.
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.