Problem 756 - possible memory leak in G4Navigator on Mac OS 10.3
Summary: possible memory leak in G4Navigator on Mac OS 10.3
Status: RESOLVED WORKSFORME
Alias: None
Product: Geant4
Classification: Unclassified
Component: event (show other problems)
Version: 7.0
Hardware: All Other
: P2 normal
Assignee: Gabriele Cosmo
URL:
Depends on:
Blocks:
 
Reported: 2005-06-23 11:13 CEST by ldi00a
Modified: 2005-07-08 05:33 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 ldi00a 2005-06-23 11:13:46 CEST
I have noticed that there appears to be a memory leak in my simulations. So I
used apple's malloc debug program and it reports a leak with
G4Navigator::LocateGlobalPointAndUpdateTouchableHandle
this is the last function before G4AllocatorPool::Grow() is called. This shows
up in both my simulation and several of the examples I have tested. For my
simulation the program grows at about 10.7 KB per event.

I have compiled geant 4.7.0.p01 on Mac OS 10.3 running on a dual 1.8 GHz G5
using apple's version of gcc 3.3, which is the one included with xcode.
Comment 1 Gabriele Cosmo 2005-07-08 05:33:59 CEST
The call to LocateGlobalPointAndUpdateTouchableHandle() from G4Navigator is
supposed to create a handle and leave the responsibility to the caller for its
deletion. The user should check in his simulation code what use he is doing of
touchable-handles, a possible side-effect can be for example the attempt to keep
an handle in one of the generated objects (hits for example), therefore
unnecessarily creating new ones at each generation of a hit....