We are simulating a set of straw tubes (i.e. some small gas tubes arranged on a tube surface around the beamline) where the layers are rotated with a small angle (5-9 deg) versus each other. If we put the tubes directly in the world volume, everything works fine. If we use an additional (tube) mother volume (which, I think, should be the normal strategy in a compound detector) the optimization after the first /run/beamOn takes a lot of time and memory (>>100 MB). This does not rely on the shape of the mother volume. If we have no additional rotation of the tubes (i.e. all are parallel to the beam axis) the problem is gone. Is this a wanted behaviour of G4? A test program showing the behaviour can be found at the given URL.
This looks due to the current provisional strategy adopted in G4Tubs::CalculateExtent().
The behaviour is reproduced for G4Box geometry and is sensitive to the ratio of the mother/world dimensions. It should be considered by voxel optimisation experts.
After investigation of the test case provided, it turns out that the observed behavior is due to the complexity of the geometry to determine the region to be voxelised. In this case, a rather 'dense' region of volumes is placed in a large world. The class G4LogicalVolume provides two functions GetSmartless()/SetSmartless(double) to help address such cases and tune a smartless parameter for voxelisation for specific volumes, in order to optimise the voxelisation process. For future improvements in the area of geometry optimisation we're planning to extend voxelisation in 3D space and automatically apply smartless to critical areas (like in this case). Thanks for the report.