Skip to content

TrigSerializeTP: Massage the class name before passing it to TClass::GetClass to avoid ROOT memory hoarding

While investigating why some RAWtoALL jobs have a strong memory slope w/o an apparent memory-leak, e.g. this job, I noticed that it is partly related to the infamous ROOT issue we discussed at ATEAM-781.

This job reads data16 RAW input, which triggers a P->T conversion from DataVector<xAOD::TauJet_v2> to the current version, DataVector<xAOD::TauJet_v3>. The problem is that the transient name that is returned for the current version in TrigSerTPTool.cxx#L170 is the full name, i.e. DataVector<xAOD::TauJet_v3,DataVector<xAOD::IParticle,DataModel_detail::NoBase> >, and when this is passed to TClass::GetClass in TrigSerTPTool.cxx#L219 ROOT allocates memory on each call and never releases it.

One way to avoid this is to massage the class name by removing the base class information, as done in this MR using CxxUtils. Although we could get away w/ only the change in the P->T conversion part, I applied the same logic to T->P as well for consistency.

Here are the memory profiles for the same job in the latest nightly before (Vanilla) and after (Patched) this MR:

pss

For now, I'm keeping this MR in Draft mode. @ssnyder, @tamartin, @gemmeren: Could you please take a quick look and let me know what you think. Many thanks.

Edited by Alaettin Serhan Mete

Merge request reports