@@ -1167,7 +1167,14 @@ void CUnivariateTimeSeriesModel::debugMemoryUsage(core::CMemoryUsage::TMemoryUsa
11671167 mem->setName (" CUnivariateTimeSeriesModel" );
11681168 core::CMemoryDebug::dynamicSize (" m_Controllers" , m_Controllers, mem);
11691169 core::CMemoryDebug::dynamicSize (" m_TrendModel" , m_TrendModel, mem);
1170+ // We made various memory improvements in 6.4 partly in preparation for multi-bucket
1171+ // analysis. This is not going to be available until 6.5; however, we will account for
1172+ // its memory now. The memory usage is used, for example, to allocate jobs to nodes and
1173+ // to decide if there is sufficient memory to create jobs. Operationally, we therefore
1174+ // want to avoid unnecessary changes in model memory between versions. An extra residual
1175+ // model is a good proxy for the amount of memory multi-bucket will consume.
11701176 core::CMemoryDebug::dynamicSize (" m_ResidualModel" , m_ResidualModel, mem);
1177+ core::CMemoryDebug::dynamicSize (" m_ResidualModelPad" , m_ResidualModel, mem);
11711178 core::CMemoryDebug::dynamicSize (" m_AnomalyModel" , m_AnomalyModel, mem);
11721179 core::CMemoryDebug::dynamicSize (" m_ChangeDetector" , m_ChangeDetector, mem);
11731180 core::CMemoryDebug::dynamicSize (" m_SlidingWindow" , m_SlidingWindow, mem);
@@ -1176,7 +1183,8 @@ void CUnivariateTimeSeriesModel::debugMemoryUsage(core::CMemoryUsage::TMemoryUsa
11761183std::size_t CUnivariateTimeSeriesModel::memoryUsage () const {
11771184 return core::CMemory::dynamicSize (m_Controllers) +
11781185 core::CMemory::dynamicSize (m_TrendModel) +
1179- core::CMemory::dynamicSize (m_ResidualModel) +
1186+ /* see above*/
1187+ 2 * core::CMemory::dynamicSize (m_ResidualModel) +
11801188 core::CMemory::dynamicSize (m_AnomalyModel) +
11811189 core::CMemory::dynamicSize (m_ChangeDetector) +
11821190 core::CMemory::dynamicSize (m_SlidingWindow);
@@ -2440,15 +2448,23 @@ void CMultivariateTimeSeriesModel::debugMemoryUsage(core::CMemoryUsage::TMemoryU
24402448 mem->setName (" CUnivariateTimeSeriesModel" );
24412449 core::CMemoryDebug::dynamicSize (" m_Controllers" , m_Controllers, mem);
24422450 core::CMemoryDebug::dynamicSize (" m_TrendModel" , m_TrendModel, mem);
2451+ // We made various memory improvements in 6.4 partly in preparation for multi-bucket
2452+ // analysis. This is not going to be available until 6.5; however, we will account for
2453+ // its memory now. The memory usage is used, for example, to allocate jobs to nodes and
2454+ // to decide if there is sufficient memory to create jobs. Operationally, we therefore
2455+ // want to avoid unnecessary changes in model memory between versions. An extra residual
2456+ // model is a good proxy for the amount of memory multi-bucket will consume.
24432457 core::CMemoryDebug::dynamicSize (" m_ResidualModel" , m_ResidualModel, mem);
2458+ core::CMemoryDebug::dynamicSize (" m_ResidualModelPad" , m_ResidualModel, mem);
24442459 core::CMemoryDebug::dynamicSize (" m_AnomalyModel" , m_AnomalyModel, mem);
24452460 core::CMemoryDebug::dynamicSize (" m_SlidingWindow" , m_SlidingWindow, mem);
24462461}
24472462
24482463std::size_t CMultivariateTimeSeriesModel::memoryUsage () const {
24492464 return core::CMemory::dynamicSize (m_Controllers) +
24502465 core::CMemory::dynamicSize (m_TrendModel) +
2451- core::CMemory::dynamicSize (m_ResidualModel) +
2466+ /* see above*/
2467+ 2 * core::CMemory::dynamicSize (m_ResidualModel) +
24522468 core::CMemory::dynamicSize (m_AnomalyModel) +
24532469 core::CMemory::dynamicSize (m_SlidingWindow);
24542470}
0 commit comments