mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-12 16:32:12 -05:00
#11258 Grid Calculation: Unintended release of result data memory
Avoid release of memory when working on a single case
This commit is contained in:
1 parent
406cd087e9
commit
9f96cb9694
2 files changed
+8
No files matched your search
@@ -609,10 +609,13 @@ std::vector<double> RimGridCalculation::getDataForResult( const QString&
|
|||||||
values[i] = resultAccessor->cellScalarGlobIdx( activeReservoirCells[i] );
|
values[i] = resultAccessor->cellScalarGlobIdx( activeReservoirCells[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( m_releaseMemoryAfterDataIsExtracted )
|
||||||
|
{
|
||||||
auto categoriesToExclude = { RiaDefines::ResultCatType::GENERATED };
|
auto categoriesToExclude = { RiaDefines::ResultCatType::GENERATED };
|
||||||
|
|
||||||
sourceCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->freeAllocatedResultsData( categoriesToExclude, timeStepToUse );
|
sourceCase->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->freeAllocatedResultsData( categoriesToExclude, timeStepToUse );
|
||||||
sourceCase->results( RiaDefines::PorosityModelType::FRACTURE_MODEL )->freeAllocatedResultsData( categoriesToExclude, timeStepToUse );
|
sourceCase->results( RiaDefines::PorosityModelType::FRACTURE_MODEL )->freeAllocatedResultsData( categoriesToExclude, timeStepToUse );
|
||||||
|
}
|
||||||
|
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
@@ -782,6 +785,9 @@ bool RimGridCalculation::calculateForCases( const std::vector<RimEclipseCase*>&
|
|||||||
m_expression().contains( "min" ) || m_expression().contains( "max" ) ||
|
m_expression().contains( "min" ) || m_expression().contains( "max" ) ||
|
||||||
m_expression().contains( "count" );
|
m_expression().contains( "count" );
|
||||||
|
|
||||||
|
// If multiple cases are present, release memory after data is extracted to avoid memory issues.
|
||||||
|
m_releaseMemoryAfterDataIsExtracted = isMultipleCasesPresent;
|
||||||
|
|
||||||
if ( isMultipleCasesPresent )
|
if ( isMultipleCasesPresent )
|
||||||
{
|
{
|
||||||
QString txt = "Starting calculation '" + description() + "' for " + QString::number( calculationCases.size() ) + " cases.";
|
QString txt = "Starting calculation '" + description() + "' for " + QString::number( calculationCases.size() ) + " cases.";
|
||||||
|
|||||||
@@ -155,4 +155,6 @@ private:
|
|||||||
caf::PdmField<bool> m_editNonVisibleResultAddress;
|
caf::PdmField<bool> m_editNonVisibleResultAddress;
|
||||||
|
|
||||||
caf::PdmField<bool> m_applyToAllCases_OBSOLETE;
|
caf::PdmField<bool> m_applyToAllCases_OBSOLETE;
|
||||||
|
|
||||||
|
bool m_releaseMemoryAfterDataIsExtracted = false;
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user