ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
StoreGate
src
SegMemSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
StoreGate/SegMemSvc.h
"
6
7
#include "GaudiKernel/ISvcLocator.h"
8
#include "GaudiKernel/IIncidentSvc.h"
9
#include "GaudiKernel/Incident.h"
10
11
using namespace
std
;
12
13
14
//
16
//
17
18
SegMemSvc::SegMemSvc
(
const
std::string& name, ISvcLocator* svc )
19
: base_class( name, svc ),
p_incSvc
(
"IncidentSvc"
,name),
20
m_arena_job
(
"sms_job"
,&
m_ahead_job
),
21
m_arena_evt
(
"sms_evt"
,&
m_ahead_evt
),
22
m_arena_inc
(
"sms_inc"
,&
m_ahead_inc
)
23
{
24
25
}
26
27
28
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
29
30
SegMemSvc::~SegMemSvc
() {
31
32
}
33
34
35
36
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
37
38
StatusCode
39
SegMemSvc::initialize
() {
40
41
SG::Arena::Push push(
m_arena_job
);
42
SG::Arena::Push push2(
m_arena_evt
);
43
SG::Arena::Push push3(
m_arena_inc
);
44
45
// m_ahead.addArena(&m_arena);
46
47
48
p_incSvc
->addListener(
this
,
"EndEvent"
);
49
p_incSvc
->addListener(
this
,
"DefragMemory"
);
50
51
return
StatusCode::SUCCESS;
52
53
}
54
55
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
56
57
void
58
SegMemSvc::handle
(
const
Incident& inc) {
59
60
if
(inc.type() ==
"EndEvent"
) {
61
if
(msgStream().level() <= MSG::DEBUG) {
62
std::ostringstream ost;
63
m_ahead_evt
.report(ost);
64
debug
() <<
"Running report for "
<<
m_arena_evt
.name()
65
<< ost.str() <<
endmsg
;
66
}
67
68
debug
() <<
"freeing all memory allocated for Event"
<<
endmsg
;
69
m_arena_evt
.reset();
70
m_ahead_evt
.reset();
71
72
}
else
if
( inc.type() ==
"DefragMemory"
) {
73
74
if
(msgStream().level() <= MSG::DEBUG) {
75
debug
() <<
"defragmenting memory"
<<
endmsg
;
76
}
77
debug
() <<
"freeing all memory allocated associated with "
78
<<
"DefragMemory incident"
<<
endmsg
;
79
m_arena_inc
.reset();
80
m_ahead_inc
.reset();
81
}
82
83
}
84
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:61
debug
const bool debug
Definition
MakeUncertaintyPlots.cxx:53
SegMemSvc.h
SegMemSvc::m_ahead_job
SG::ArenaHeader m_ahead_job
three arenas for different lifetimes
Definition
SegMemSvc.h:81
SegMemSvc::handle
virtual void handle(const Incident &) override
Definition
SegMemSvc.cxx:58
SegMemSvc::m_ahead_evt
SG::ArenaHeader m_ahead_evt
Definition
SegMemSvc.h:81
SegMemSvc::~SegMemSvc
virtual ~SegMemSvc()
Definition
SegMemSvc.cxx:30
SegMemSvc::m_arena_inc
SG::Arena m_arena_inc
Definition
SegMemSvc.h:82
SegMemSvc::initialize
virtual StatusCode initialize() override
Definition
SegMemSvc.cxx:39
SegMemSvc::m_arena_job
SG::Arena m_arena_job
Definition
SegMemSvc.h:82
SegMemSvc::m_arena_evt
SG::Arena m_arena_evt
Definition
SegMemSvc.h:82
SegMemSvc::SegMemSvc
SegMemSvc(const std::string &name, ISvcLocator *svc)
Definition
SegMemSvc.cxx:18
SegMemSvc::p_incSvc
ServiceHandle< IIncidentSvc > p_incSvc
Definition
SegMemSvc.h:68
SegMemSvc::m_ahead_inc
SG::ArenaHeader m_ahead_inc
Definition
SegMemSvc.h:81
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0