diff --git a/src/libs/antares/array/include/antares/array/matrix.h b/src/libs/antares/array/include/antares/array/matrix.h index 42432a0ae1..64d65b0e18 100644 --- a/src/libs/antares/array/include/antares/array/matrix.h +++ b/src/libs/antares/array/include/antares/array/matrix.h @@ -415,13 +415,6 @@ class Matrix */ bool empty() const; - //! Get the amount of memory used by the matrix - uint64_t memoryUsage() const; - - //! Get the amount of memory used by the matrix - uint64_t valuesMemoryUsage() const; - //@} - /*! ** \brief Print the matrix to std::cout (debug) */ diff --git a/src/libs/antares/array/include/antares/array/matrix.hxx b/src/libs/antares/array/include/antares/array/matrix.hxx index c95db1bd93..6e1fb3b9a0 100644 --- a/src/libs/antares/array/include/antares/array/matrix.hxx +++ b/src/libs/antares/array/include/antares/array/matrix.hxx @@ -528,19 +528,6 @@ inline bool Matrix::empty() const return (!width) or (!height); } -template -inline uint64_t Matrix::memoryUsage() const -{ - return sizeof(Matrix) + (sizeof(T) * (width * height)) - + ((jit) ? jit->memoryUsage() : 0); -} - -template -inline uint64_t Matrix::valuesMemoryUsage() const -{ - return (sizeof(T) * (width * height)); -} - template void Matrix::clear() { diff --git a/src/libs/antares/correlation/correlation.cpp b/src/libs/antares/correlation/correlation.cpp index efdf3b3769..a294d2cb5c 100644 --- a/src/libs/antares/correlation/correlation.cpp +++ b/src/libs/antares/correlation/correlation.cpp @@ -557,23 +557,6 @@ void Correlation::set(Matrix<>& m, const Area& from, const Area& to, double v) m[to.index][from.index] = v; } -uint64_t Correlation::memoryUsage() const -{ - uint64_t r = sizeof(Correlation); - if (!annual.empty()) - { - r += annual.memoryUsage(); - } - if (!monthly.empty()) - { - for (uint i = 0; i != 12; ++i) - { - r += monthly[i].memoryUsage(); - } - } - return r; -} - bool Correlation::forceReload(bool reload) const { bool ret = true; diff --git a/src/libs/antares/correlation/include/antares/correlation/correlation.h b/src/libs/antares/correlation/include/antares/correlation/correlation.h index c0ffebe4a0..c5770021b5 100644 --- a/src/libs/antares/correlation/include/antares/correlation/correlation.h +++ b/src/libs/antares/correlation/include/antares/correlation/correlation.h @@ -123,11 +123,6 @@ class Correlation final const AreaNameMapping& mapping, const Study& study); - /*! - ** \brief Get the amount of memory used the correlation matrices - */ - uint64_t memoryUsage() const; - /*! ** \brief Invalidate all matrices */ diff --git a/src/libs/antares/jit/include/antares/jit/jit.h b/src/libs/antares/jit/include/antares/jit/jit.h index 9354a792d4..b54aed0e4d 100644 --- a/src/libs/antares/jit/include/antares/jit/jit.h +++ b/src/libs/antares/jit/include/antares/jit/jit.h @@ -134,9 +134,6 @@ class JIT final */ void markAsModified(); - //! Get the amount of memory currently used - uint64_t memoryUsage() const; - public: //! Filename/folder to consider if some data should be loaded YString sourceFilename; diff --git a/src/libs/antares/jit/include/antares/jit/jit.hxx b/src/libs/antares/jit/include/antares/jit/jit.hxx index a19342e7e4..62c9c6a1c4 100644 --- a/src/libs/antares/jit/include/antares/jit/jit.hxx +++ b/src/libs/antares/jit/include/antares/jit/jit.hxx @@ -30,11 +30,6 @@ inline bool JIT::IsReady(JIT::Informations* j) return (!j or j->alreadyLoaded); } -inline uint64_t JIT::Informations::memoryUsage() const -{ - return sizeof(JIT::Informations) + sourceFilename.capacity(); -} - inline void JIT::Informations::markAsModified() { modified = true; diff --git a/src/libs/antares/memory/include/antares/memory/memory.h b/src/libs/antares/memory/include/antares/memory/memory.h index 42515c5fce..67cd52bfc4 100644 --- a/src/libs/antares/memory/include/antares/memory/memory.h +++ b/src/libs/antares/memory/include/antares/memory/memory.h @@ -91,11 +91,6 @@ class Memory final: public Yuni::Policy::ObjectLevelLockable void cacheFolder(const AnyString& folder); //@} - /*! - ** \brief Get the amount of memory currently used - */ - uint64_t memoryUsage() const; - /*! ** \brief Get the process ID of the application ** diff --git a/src/libs/antares/series/include/antares/series/series.h b/src/libs/antares/series/include/antares/series/series.h index f762e710fa..48dd0dfd07 100644 --- a/src/libs/antares/series/include/antares/series/series.h +++ b/src/libs/antares/series/include/antares/series/series.h @@ -108,7 +108,6 @@ class TimeSeries bool forceReload(bool reload = false) const; void markAsModified() const; - uint64_t memoryUsage() const; TS timeSeries; TimeSeriesNumbers& timeseriesNumbers; diff --git a/src/libs/antares/series/series.cpp b/src/libs/antares/series/series.cpp index 4c0cca690e..c92f7812cc 100644 --- a/src/libs/antares/series/series.cpp +++ b/src/libs/antares/series/series.cpp @@ -225,8 +225,4 @@ void TimeSeries::markAsModified() const timeSeries.markAsModified(); } -uint64_t TimeSeries::memoryUsage() const -{ - return timeSeries.memoryUsage(); -} } // namespace Antares::Data diff --git a/src/libs/antares/study/CMakeLists.txt b/src/libs/antares/study/CMakeLists.txt index a3524a4b96..a354de3058 100644 --- a/src/libs/antares/study/CMakeLists.txt +++ b/src/libs/antares/study/CMakeLists.txt @@ -179,7 +179,6 @@ source_group("study\\constraint" FILES ${SRC_STUDY_BINDING_CONSTRAINT}) set(SRC_XCAST include/antares/study/xcast.h include/antares/study/xcast/xcast.h - include/antares/study/xcast/xcast.hxx xcast/xcast.cpp ) source_group("study\\xcast" FILES ${SRC_XCAST}) diff --git a/src/libs/antares/study/area/area.cpp b/src/libs/antares/study/area/area.cpp index 3bd4b91222..6573a23e14 100644 --- a/src/libs/antares/study/area/area.cpp +++ b/src/libs/antares/study/area/area.cpp @@ -167,52 +167,6 @@ const AreaLink* Area::findExistingLinkWith(const Area& with) const return nullptr; } -uint64_t Area::memoryUsage() const -{ - uint64_t ret = 0; - - // Misc gen. (previously called Fatal hors hydro) - ret += miscGen.valuesMemoryUsage(); - // Reserves - ret += reserves.valuesMemoryUsage(); - - ret += sizeof(Area); - // Load - ret += load.memoryUsage(); - // Solar - ret += solar.memoryUsage(); - // Wind - ret += wind.memoryUsage(); - - // Hydro - ret += PreproHydroMemoryUsage(hydro.prepro.get()); - if (hydro.series) - { - ret += hydro.series->memoryUsage(); - } - - // Thermal - ret += thermal.list.memoryUsage(); - - // Renewable - ret += renewable.list.memoryUsage(); - - // UI - if (ui) - { - ret += ui->memoryUsage(); - } - - // links - auto end = links.end(); - for (auto i = links.begin(); i != end; ++i) - { - ret += (i->second)->memoryUsage(); - } - - return ret; -} - void Area::createMissingData() { createMissingTimeSeries(); diff --git a/src/libs/antares/study/area/links.cpp b/src/libs/antares/study/area/links.cpp index 97668638e0..3c2059b3f6 100644 --- a/src/libs/antares/study/area/links.cpp +++ b/src/libs/antares/study/area/links.cpp @@ -769,16 +769,6 @@ void AreaLinkRemove(AreaLink* link) delete link; } -uint64_t AreaLink::memoryUsage() const -{ - uint64_t to_return = sizeof(AreaLink); - to_return += parameters.valuesMemoryUsage(); - to_return += directCapacities.memoryUsage(); - to_return += indirectCapacities.memoryUsage(); - - return to_return; -} - bool AreaLink::forceReload(bool reload) const { return parameters.forceReload(reload) && directCapacities.forceReload(reload) diff --git a/src/libs/antares/study/area/list.cpp b/src/libs/antares/study/area/list.cpp index 0f95023f33..ec7bcd3ef2 100644 --- a/src/libs/antares/study/area/list.cpp +++ b/src/libs/antares/study/area/list.cpp @@ -1394,13 +1394,6 @@ void AreaListEnsureDataThermalPrepro(AreaList* l) l->each([](Data::Area& area) { area.thermal.list.ensureDataPrepro(); }); } -uint64_t AreaList::memoryUsage() const -{ - uint64_t ret = sizeof(AreaList) + sizeof(Area**) * areas.size(); - each([&ret](const Data::Area& area) { ret += area.memoryUsage(); }); - return ret; -} - uint AreaList::areaLinkCount() const { uint ret = 0; diff --git a/src/libs/antares/study/area/ui.cpp b/src/libs/antares/study/area/ui.cpp index cd3f0bb5fd..39cb998bf4 100644 --- a/src/libs/antares/study/area/ui.cpp +++ b/src/libs/antares/study/area/ui.cpp @@ -363,11 +363,6 @@ bool AreaUI::saveToFile(const AnyString& filename, bool force) const return true; } -uint64_t AreaUI::memoryUsage() const -{ - return sizeof(AreaUI); -} - bool AreaUI::modified() const { return pModified; diff --git a/src/libs/antares/study/binding_constraint/BindingConstraint.cpp b/src/libs/antares/study/binding_constraint/BindingConstraint.cpp index abdce0befb..b950773dd4 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraint.cpp +++ b/src/libs/antares/study/binding_constraint/BindingConstraint.cpp @@ -506,23 +506,6 @@ void BindingConstraint::buildFormula(Yuni::String& s) const } } -uint64_t BindingConstraint::memoryUsage() const -{ - return sizeof(BindingConstraint) - // comments - + pComments.capacity() - // Values - + RHSTimeSeries().memoryUsage() - // Estimation - + pLinkWeights.size() * (sizeof(double) + 3 * sizeof(void*)) - // Estimation - + pLinkOffsets.size() * (sizeof(int) + 3 * sizeof(void*)) - // Estimation - + pClusterWeights.size() * (sizeof(double) + 3 * sizeof(void*)) - // Estimation - + pClusterOffsets.size() * (sizeof(int) + 3 * sizeof(void*)); -} - bool BindingConstraint::contains(const BindingConstraint* bc) const { return (this == bc); diff --git a/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp b/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp index e68c97d15c..7ed09d8e09 100644 --- a/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp +++ b/src/libs/antares/study/binding_constraint/BindingConstraintsRepository.cpp @@ -315,16 +315,6 @@ void BindingConstraintsRepository::reverseWeightSign(const AreaLink* lnk) each([&lnk](BindingConstraint& constraint) { constraint.reverseWeightSign(lnk); }); } -uint64_t BindingConstraintsRepository::memoryUsage() const -{ - uint64_t m = sizeof(BindingConstraintsRepository); - for (const auto& i: constraints_) - { - m += i->memoryUsage(); - } - return m; -} - namespace // anonymous { template diff --git a/src/libs/antares/study/include/antares/study/area/area.h b/src/libs/antares/study/include/antares/study/area/area.h index fea12cea10..7567bb25ca 100644 --- a/src/libs/antares/study/include/antares/study/area/area.h +++ b/src/libs/antares/study/include/antares/study/area/area.h @@ -188,17 +188,6 @@ class Area final: private Yuni::NonCopyable */ void markAsModified() const; - /*! - ** \brief Get the amount of memory currently used by the area - */ - uint64_t memoryUsage() const; - - /*! - ** \brief Try to estimate the amount of memory required by the area for a simulation - */ - - //@} - //! \name Thermal clusters min stable power validity checking //@{ /*! @@ -656,22 +645,6 @@ class AreaList final: public Yuni::NonCopyable /// create a map with the corresponding scratchpad for each area link to this numspace Area::ScratchMap buildScratchMap(uint numspace); - //! \name Memory management - //@{ - /*! - ** \brief Try to estimate the amount of memory required by the class for a simulation - */ - - /*! - ** \brief Get the average amount of memory currently used by each area - */ - double memoryUsageAveragePerArea() const; - - /*! - ** \brief Get the amount of memory currently used by the class - */ - uint64_t memoryUsage() const; - /*! ** \brief Update the name id set */ diff --git a/src/libs/antares/study/include/antares/study/area/links.h b/src/libs/antares/study/include/antares/study/area/links.h index fd4b8e69d8..960f3c36ec 100644 --- a/src/libs/antares/study/include/antares/study/area/links.h +++ b/src/libs/antares/study/include/antares/study/area/links.h @@ -106,13 +106,6 @@ class AreaLink final: public Yuni::NonCopyable void markAsModified() const; //@} - //! \name Memory management - //@{ - /*! - ** \brief Get the size (bytes) in memory occupied by a `AreaLink` structure - */ - uint64_t memoryUsage() const; - bool isVisibleOnLayer(const size_t& layerID) const; Yuni::String getName() const; diff --git a/src/libs/antares/study/include/antares/study/area/ui.h b/src/libs/antares/study/include/antares/study/area/ui.h index 9ab5f39c8b..ddc03e7c4e 100644 --- a/src/libs/antares/study/include/antares/study/area/ui.h +++ b/src/libs/antares/study/include/antares/study/area/ui.h @@ -63,11 +63,6 @@ class AreaUI final */ bool saveToFile(const AnyString& filename, bool force = false) const; - /*! - ** \brief Amount of memory consummed by the instance - */ - uint64_t memoryUsage() const; - /*! ** \brief Get if the structure has been modified */ diff --git a/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraint.h b/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraint.h index e88c7b1bb6..1643c317bf 100644 --- a/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraint.h +++ b/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraint.h @@ -338,14 +338,6 @@ class BindingConstraint final: public Yuni::NonCopyable */ void markAsModified() const; - //! \name Memory Usage - //@{ - /*! - ** \brief Get the memory usage - */ - uint64_t memoryUsage() const; - //@} - /*! ** \brief Reverse the sign of the weight for a given interconnection or thermal cluster ** diff --git a/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraintsRepository.h b/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraintsRepository.h index 25809de754..ea3f8bbb5b 100644 --- a/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraintsRepository.h +++ b/src/libs/antares/study/include/antares/study/binding_constraint/BindingConstraintsRepository.h @@ -157,11 +157,6 @@ class BindingConstraintsRepository final: public Yuni::NonCopyable */ void markAsModified() const; - /*! - ** \brief Get the amount of memory currently used by the class - */ - uint64_t memoryUsage() const; - //! Data for the pre-processor std::unique_ptr prepro; diff --git a/src/libs/antares/study/include/antares/study/parts/load/prepro.h b/src/libs/antares/study/include/antares/study/parts/load/prepro.h index bbe3c7a008..e434fe1c01 100644 --- a/src/libs/antares/study/include/antares/study/parts/load/prepro.h +++ b/src/libs/antares/study/include/antares/study/parts/load/prepro.h @@ -59,11 +59,6 @@ class Prepro */ bool saveToFolder(const AnyString& folder) const; - /*! - ** \brief Get the amount of memory currently used - */ - uint64_t memoryUsage() const; - /*! ** \brief Make sure that all data are loaded in memory */ diff --git a/src/libs/antares/study/include/antares/study/parts/load/prepro.hxx b/src/libs/antares/study/include/antares/study/parts/load/prepro.hxx index c0bb3b6f6d..7c39772bbf 100644 --- a/src/libs/antares/study/include/antares/study/parts/load/prepro.hxx +++ b/src/libs/antares/study/include/antares/study/parts/load/prepro.hxx @@ -24,11 +24,6 @@ namespace Antares::Data::Load { -inline uint64_t Prepro::memoryUsage() const -{ - return xcast.memoryUsage(); -} - inline bool Prepro::forceReload(bool reload) const { return xcast.forceReload(reload); diff --git a/src/libs/antares/study/include/antares/study/parts/renewable/cluster.h b/src/libs/antares/study/include/antares/study/parts/renewable/cluster.h index 3651706149..2a47b54bfe 100644 --- a/src/libs/antares/study/include/antares/study/parts/renewable/cluster.h +++ b/src/libs/antares/study/include/antares/study/parts/renewable/cluster.h @@ -128,12 +128,6 @@ class RenewableCluster final: public Cluster */ uint groupId() const override; - /*! - ** \brief Get the memory consummed by the renewable cluster (in bytes) - */ - uint64_t memoryUsage() const override; - //@} - bool setTimeSeriesModeFromString(const YString& value); YString getTimeSeriesModeAsString() const; diff --git a/src/libs/antares/study/include/antares/study/parts/renewable/cluster_list.h b/src/libs/antares/study/include/antares/study/parts/renewable/cluster_list.h index 275d495020..f8798845dc 100644 --- a/src/libs/antares/study/include/antares/study/parts/renewable/cluster_list.h +++ b/src/libs/antares/study/include/antares/study/parts/renewable/cluster_list.h @@ -36,7 +36,6 @@ class RenewableClusterList: public ClusterList { public: std::string typeID() const override; - uint64_t memoryUsage() const override; bool loadFromFolder(const AnyString& folder, Area* area); bool validateClusters() const; diff --git a/src/libs/antares/study/include/antares/study/parts/solar/container.h b/src/libs/antares/study/include/antares/study/parts/solar/container.h index 390b72cd90..1fcbcda9e5 100644 --- a/src/libs/antares/study/include/antares/study/parts/solar/container.h +++ b/src/libs/antares/study/include/antares/study/parts/solar/container.h @@ -59,11 +59,6 @@ class Container */ void markAsModified() const; - /*! - ** \brief Get the amount of memory currently used by the class - */ - uint64_t memoryUsage() const; - //! Data for the pre-processor std::unique_ptr prepro; diff --git a/src/libs/antares/study/include/antares/study/parts/solar/prepro.h b/src/libs/antares/study/include/antares/study/parts/solar/prepro.h index 4365c0c6cf..da559acd99 100644 --- a/src/libs/antares/study/include/antares/study/parts/solar/prepro.h +++ b/src/libs/antares/study/include/antares/study/parts/solar/prepro.h @@ -59,11 +59,6 @@ class Prepro */ bool saveToFolder(const AnyString& folder) const; - /*! - ** \brief Get the amount of memory currently used - */ - uint64_t memoryUsage() const; - /*! ** \brief Make sure that all data are loaded in memory */ diff --git a/src/libs/antares/study/include/antares/study/parts/solar/prepro.hxx b/src/libs/antares/study/include/antares/study/parts/solar/prepro.hxx index 5bf5a90d98..b32aec13be 100644 --- a/src/libs/antares/study/include/antares/study/parts/solar/prepro.hxx +++ b/src/libs/antares/study/include/antares/study/parts/solar/prepro.hxx @@ -23,11 +23,6 @@ namespace Antares::Data::Solar { -inline uint64_t Prepro::memoryUsage() const -{ - return xcast.memoryUsage(); -} - inline bool Prepro::forceReload(bool reload) const { return xcast.forceReload(reload); diff --git a/src/libs/antares/study/include/antares/study/parts/thermal/cluster.h b/src/libs/antares/study/include/antares/study/parts/thermal/cluster.h index 9216ac88aa..09ada6b8c1 100644 --- a/src/libs/antares/study/include/antares/study/parts/thermal/cluster.h +++ b/src/libs/antares/study/include/antares/study/parts/thermal/cluster.h @@ -185,12 +185,6 @@ class ThermalCluster final: public Cluster, public std::enable_shared_from_this< */ uint groupId() const override; - /*! - ** \brief Get the memory consummed by the thermal cluster (in bytes) - */ - uint64_t memoryUsage() const override; - //@} - //! \name validity of Min Stable Power //@{ // bool minStablePowerValidity() const; diff --git a/src/libs/antares/study/include/antares/study/parts/thermal/cluster_list.h b/src/libs/antares/study/include/antares/study/parts/thermal/cluster_list.h index af3e096225..1aab721b56 100644 --- a/src/libs/antares/study/include/antares/study/parts/thermal/cluster_list.h +++ b/src/libs/antares/study/include/antares/study/parts/thermal/cluster_list.h @@ -38,7 +38,6 @@ class ThermalClusterList: public ClusterList { public: std::string typeID() const override; - uint64_t memoryUsage() const override; /*! ** \brief Get the size (bytes) occupied in memory by a `ThermalClusterList` structure diff --git a/src/libs/antares/study/include/antares/study/parts/thermal/ecoInput.h b/src/libs/antares/study/include/antares/study/parts/thermal/ecoInput.h index c0456b8653..f538aa41cf 100644 --- a/src/libs/antares/study/include/antares/study/parts/thermal/ecoInput.h +++ b/src/libs/antares/study/include/antares/study/parts/thermal/ecoInput.h @@ -73,11 +73,6 @@ class EconomicInputData */ bool saveToFolder(const AnyString& folder) const; - /*! - ** \brief Get the amount of memory used by the class - */ - uint64_t memoryUsage() const; - //! All {FO,PO}{Duration,Rate} annual values // max x DAYS_PER_YEAR TimeSeries::TS fuelcost; diff --git a/src/libs/antares/study/include/antares/study/parts/wind/container.h b/src/libs/antares/study/include/antares/study/parts/wind/container.h index ba149068f5..21d46d3a83 100644 --- a/src/libs/antares/study/include/antares/study/parts/wind/container.h +++ b/src/libs/antares/study/include/antares/study/parts/wind/container.h @@ -59,11 +59,6 @@ class Container */ void markAsModified() const; - /*! - ** \brief Get the amount of memory currently used by the class - */ - uint64_t memoryUsage() const; - //! Data for the pre-processor std::unique_ptr prepro; diff --git a/src/libs/antares/study/include/antares/study/parts/wind/prepro.h b/src/libs/antares/study/include/antares/study/parts/wind/prepro.h index 1d0ed8722e..2e75729b26 100644 --- a/src/libs/antares/study/include/antares/study/parts/wind/prepro.h +++ b/src/libs/antares/study/include/antares/study/parts/wind/prepro.h @@ -56,11 +56,6 @@ class Prepro */ bool saveToFolder(const AnyString& folder) const; - /*! - ** \brief Get the amount of memory currently used - */ - uint64_t memoryUsage() const; - /*! ** \brief Make sure that all data are loaded in memory */ diff --git a/src/libs/antares/study/include/antares/study/parts/wind/prepro.hxx b/src/libs/antares/study/include/antares/study/parts/wind/prepro.hxx index 5013c89f8c..a52b568902 100644 --- a/src/libs/antares/study/include/antares/study/parts/wind/prepro.hxx +++ b/src/libs/antares/study/include/antares/study/parts/wind/prepro.hxx @@ -24,11 +24,6 @@ namespace Antares::Data::Wind { -inline uint64_t Prepro::memoryUsage() const -{ - return xcast.memoryUsage(); -} - inline bool Prepro::forceReload(bool reload) const { return xcast.forceReload(reload); diff --git a/src/libs/antares/study/include/antares/study/simulation.h b/src/libs/antares/study/include/antares/study/simulation.h index b3ca6addd8..14d93d2568 100644 --- a/src/libs/antares/study/include/antares/study/simulation.h +++ b/src/libs/antares/study/include/antares/study/simulation.h @@ -65,9 +65,6 @@ class SimulationComments final void saveUsingWriter(Solver::IResultWriter& writer, const AnyString& folder) const; - //! Get (in bytes) the amount of memory used by the class - uint64_t memoryUsage() const; - public: //! Comments YString comments; diff --git a/src/libs/antares/study/include/antares/study/study.h b/src/libs/antares/study/include/antares/study/study.h index 9b348a28f5..7172948641 100644 --- a/src/libs/antares/study/include/antares/study/study.h +++ b/src/libs/antares/study/include/antares/study/study.h @@ -428,11 +428,6 @@ class Study: public Yuni::NonCopyable, public LayerData */ void ensureDataAreLoadedForAllBindingConstraints(); - /*! - ** \brief Get the amound of memory consummed by the study (in bytes) - */ - uint64_t memoryUsage() const; - //! \name Logs //@{ /*! diff --git a/src/libs/antares/study/include/antares/study/ui-runtimeinfos.h b/src/libs/antares/study/include/antares/study/ui-runtimeinfos.h index 61409977b3..0417cdaddb 100644 --- a/src/libs/antares/study/include/antares/study/ui-runtimeinfos.h +++ b/src/libs/antares/study/include/antares/study/ui-runtimeinfos.h @@ -137,8 +137,6 @@ class UIRuntimeInfo final uint visibleLinksCount(uint layerID); - uint64_t memoryUsage() const; - public: //! Areas ordered by their name + links ordered by their name Area::LinkMap orderedAreasAndLinks; diff --git a/src/libs/antares/study/include/antares/study/xcast/xcast.h b/src/libs/antares/study/include/antares/study/xcast/xcast.h index cc7e281763..a029eeaef7 100644 --- a/src/libs/antares/study/include/antares/study/xcast/xcast.h +++ b/src/libs/antares/study/include/antares/study/xcast/xcast.h @@ -159,17 +159,6 @@ class XCast final: private Yuni::NonCopyable */ void markAsModified() const; - /*! - ** \brief Get the amount of memory currently used by the XCast data - */ - uint64_t memoryUsage() const; - - /*! - ** \brief Estimate the amount of memory required by this class for a simulation - */ - - //@} - public: /*! ** \brief Data required for XCast: coefficients (coeffMax x 12) @@ -214,6 +203,4 @@ class XCast final: private Yuni::NonCopyable } // namespace Antares::Data -#include "xcast.hxx" - #endif // __ANTARES_LIBS_STUDY_XCAST_XCAST_H__ diff --git a/src/libs/antares/study/include/antares/study/xcast/xcast.hxx b/src/libs/antares/study/include/antares/study/xcast/xcast.hxx deleted file mode 100644 index e5072fb81e..0000000000 --- a/src/libs/antares/study/include/antares/study/xcast/xcast.hxx +++ /dev/null @@ -1,39 +0,0 @@ -/* -** Copyright 2007-2024, RTE (https://www.rte-france.com) -** See AUTHORS.txt -** SPDX-License-Identifier: MPL-2.0 -** This file is part of Antares-Simulator, -** Adequacy and Performance assessment for interconnected energy networks. -** -** Antares_Simulator is free software: you can redistribute it and/or modify -** it under the terms of the Mozilla Public Licence 2.0 as published by -** the Mozilla Foundation, either version 2 of the License, or -** (at your option) any later version. -** -** Antares_Simulator is distributed in the hope that it will be useful, -** but WITHOUT ANY WARRANTY; without even the implied warranty of -** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -** Mozilla Public Licence 2.0 for more details. -** -** You should have received a copy of the Mozilla Public Licence 2.0 -** along with Antares_Simulator. If not, see . -*/ -#ifndef __ANTARES_LIBS_STUDY_XCAST_XCAST_HXX__ -#define __ANTARES_LIBS_STUDY_XCAST_XCAST_HXX__ - -#include - -namespace Antares -{ -namespace Data -{ -inline uint64_t XCast::memoryUsage() const -{ - return sizeof(XCast) + data.memoryUsage() + K.memoryUsage() + translation.memoryUsage() - + conversion.memoryUsage(); -} - -} // namespace Data -} // namespace Antares - -#endif // __ANTARES_LIBS_STUDY_XCAST_XCAST_HXX__ diff --git a/src/libs/antares/study/parameters.cpp b/src/libs/antares/study/parameters.cpp index 72be2dd7b4..3772c4dd19 100644 --- a/src/libs/antares/study/parameters.cpp +++ b/src/libs/antares/study/parameters.cpp @@ -1376,12 +1376,6 @@ void Parameters::validateOptions(const StudyLoadOptions& options) handleOptimizationOptions(options); } -uint64_t Parameters::memoryUsage() const -{ - return sizeof(Parameters) + yearsWeight.size() * sizeof(double) - + yearsFilter.size(); // vector of bools, 1 bit per coefficient -} - void Parameters::resetYearsWeigth() { yearsWeight.clear(); diff --git a/src/libs/antares/study/parts/hydro/prepro.cpp b/src/libs/antares/study/parts/hydro/prepro.cpp index 13711759f4..772655567a 100644 --- a/src/libs/antares/study/parts/hydro/prepro.cpp +++ b/src/libs/antares/study/parts/hydro/prepro.cpp @@ -92,11 +92,6 @@ PreproHydro::PreproHydro() { } -uint64_t PreproHydroMemoryUsage(PreproHydro* h) -{ - return (h) ? sizeof(double) : 0; -} - void PreproHydro::reset() { intermonthlyCorrelation = 0.5; diff --git a/src/libs/antares/study/parts/hydro/series.cpp b/src/libs/antares/study/parts/hydro/series.cpp index 52a087b975..c816be84a0 100644 --- a/src/libs/antares/study/parts/hydro/series.cpp +++ b/src/libs/antares/study/parts/hydro/series.cpp @@ -213,12 +213,6 @@ bool DataSeriesHydro::saveToFolder(const AreaName& areaID, const AnyString& fold return false; } -uint64_t DataSeriesHydro::memoryUsage() const -{ - return sizeof(double) + ror.memoryUsage() + storage.memoryUsage() + mingen.memoryUsage() - + maxHourlyGenPower.memoryUsage() + maxHourlyPumpPower.memoryUsage(); -} - uint DataSeriesHydro::TScount() const { const std::vector nbColumns({storage.numberOfColumns(), diff --git a/src/libs/antares/study/parts/load/container.cpp b/src/libs/antares/study/parts/load/container.cpp index 364b761985..3866deee9f 100644 --- a/src/libs/antares/study/parts/load/container.cpp +++ b/src/libs/antares/study/parts/load/container.cpp @@ -55,11 +55,6 @@ void Container::markAsModified() const } } -uint64_t Container::memoryUsage() const -{ - return sizeof(Container) + series.memoryUsage() + ((!prepro) ? 0 : prepro->memoryUsage()); -} - void Container::resetToDefault() { series.reset(); diff --git a/src/libs/antares/study/parts/renewable/cluster.cpp b/src/libs/antares/study/parts/renewable/cluster.cpp index 749ed53a57..a89872d4f9 100644 --- a/src/libs/antares/study/parts/renewable/cluster.cpp +++ b/src/libs/antares/study/parts/renewable/cluster.cpp @@ -201,13 +201,6 @@ double RenewableCluster::valueAtTimeStep(uint year, uint hourInYear) const return 0.; } -uint64_t RenewableCluster::memoryUsage() const -{ - uint64_t amount = sizeof(RenewableCluster); - amount += series.memoryUsage(); - return amount; -} - unsigned int RenewableCluster::precision() const { return 4; diff --git a/src/libs/antares/study/parts/renewable/cluster_list.cpp b/src/libs/antares/study/parts/renewable/cluster_list.cpp index aa1c915a75..2b1ac3d3b6 100644 --- a/src/libs/antares/study/parts/renewable/cluster_list.cpp +++ b/src/libs/antares/study/parts/renewable/cluster_list.cpp @@ -38,13 +38,6 @@ std::string RenewableClusterList::typeID() const return "renewables"; } -uint64_t RenewableClusterList::memoryUsage() const -{ - uint64_t ret = sizeof(RenewableClusterList) + (2 * sizeof(void*)) * enabledCount(); - std::ranges::for_each(each_enabled(), [&ret](const auto c) { ret += c->memoryUsage(); }); - return ret; -} - bool RenewableClusterList::saveToFolder(const AnyString& folder) const { // Make sure the folder is created diff --git a/src/libs/antares/study/parts/solar/container.cpp b/src/libs/antares/study/parts/solar/container.cpp index 08c85a0cc0..19275684e4 100644 --- a/src/libs/antares/study/parts/solar/container.cpp +++ b/src/libs/antares/study/parts/solar/container.cpp @@ -55,11 +55,6 @@ void Container::markAsModified() const } } -uint64_t Container::memoryUsage() const -{ - return sizeof(Container) + series.memoryUsage() + ((!prepro) ? 0 : prepro->memoryUsage()); -} - void Container::resetToDefault() { series.reset(); diff --git a/src/libs/antares/study/parts/thermal/cluster.cpp b/src/libs/antares/study/parts/thermal/cluster.cpp index 9198bc1ec6..f85fae235e 100644 --- a/src/libs/antares/study/parts/thermal/cluster.cpp +++ b/src/libs/antares/study/parts/thermal/cluster.cpp @@ -616,18 +616,6 @@ const char* Data::ThermalCluster::GroupName(enum ThermalDispatchableGroup grp) return ""; } -uint64_t ThermalCluster::memoryUsage() const -{ - uint64_t amount = sizeof(ThermalCluster) + modulation.memoryUsage(); - if (prepro) - { - amount += prepro->memoryUsage(); - } - amount += series.memoryUsage(); - amount += ecoInput.memoryUsage(); - return amount; -} - void ThermalCluster::calculatMinDivModulation() { minDivModulation.value = (modulation[thermalModulationCapacity][0] diff --git a/src/libs/antares/study/parts/thermal/cluster_list.cpp b/src/libs/antares/study/parts/thermal/cluster_list.cpp index 05dec064cc..99d7fc21ac 100644 --- a/src/libs/antares/study/parts/thermal/cluster_list.cpp +++ b/src/libs/antares/study/parts/thermal/cluster_list.cpp @@ -63,14 +63,6 @@ std::string ThermalClusterList::typeID() const return "thermal"; } -uint64_t ThermalClusterList::memoryUsage() const -{ - uint64_t ret = sizeof(ThermalClusterList) + (2 * sizeof(void*)) * enabledAndMustRunCount(); - std::ranges::for_each(each_enabled_and_not_mustrun(), - [&ret](const auto c) { ret += c->memoryUsage(); }); - return ret; -} - static bool ThermalClusterLoadFromSection(const AnyString& filename, ThermalCluster& cluster, const IniFile::Section& section); diff --git a/src/libs/antares/study/parts/thermal/ecoInput.cpp b/src/libs/antares/study/parts/thermal/ecoInput.cpp index c64b65a33d..a25c666f33 100644 --- a/src/libs/antares/study/parts/thermal/ecoInput.cpp +++ b/src/libs/antares/study/parts/thermal/ecoInput.cpp @@ -123,9 +123,4 @@ void EconomicInputData::reset() co2cost.reset(1, HOURS_PER_YEAR, true); } -uint64_t EconomicInputData::memoryUsage() const -{ - return sizeof(EconomicInputData); -} - } // namespace Antares::Data diff --git a/src/libs/antares/study/parts/wind/container.cpp b/src/libs/antares/study/parts/wind/container.cpp index 64575b73ab..bf90f779b8 100644 --- a/src/libs/antares/study/parts/wind/container.cpp +++ b/src/libs/antares/study/parts/wind/container.cpp @@ -54,11 +54,6 @@ void Container::markAsModified() const } } -uint64_t Container::memoryUsage() const -{ - return sizeof(Container) + series.memoryUsage() + ((!prepro) ? 0 : prepro->memoryUsage()); -} - void Container::resetToDefault() { series.reset(); diff --git a/src/libs/antares/study/runtime/runtime.cpp b/src/libs/antares/study/runtime/runtime.cpp index bef958919d..3bca4404a5 100644 --- a/src/libs/antares/study/runtime/runtime.cpp +++ b/src/libs/antares/study/runtime/runtime.cpp @@ -366,7 +366,6 @@ bool StudyRuntimeInfos::loadFromStudy(Study& study) logs.info() << " binding constraints: " << study.bindingConstraints.activeConstraints().size(); logs.info() << " geographic trimming:" << (gd.geographicTrimming ? "true" : "false"); - logs.info() << " memory : " << ((study.memoryUsage()) / 1024 / 1024) << "Mo"; logs.info(); return true; diff --git a/src/libs/antares/study/simulation.cpp b/src/libs/antares/study/simulation.cpp index cb4465130a..12db9184ca 100644 --- a/src/libs/antares/study/simulation.cpp +++ b/src/libs/antares/study/simulation.cpp @@ -90,10 +90,5 @@ bool SimulationComments::loadFromFolder(const StudyLoadOptions& options) return true; } -uint64_t SimulationComments::memoryUsage() const -{ - return name.capacity() + comments.capacity(); -} - } // namespace Data } // namespace Antares diff --git a/src/libs/antares/study/study.cpp b/src/libs/antares/study/study.cpp index 1b5493e750..39130a968e 100644 --- a/src/libs/antares/study/study.cpp +++ b/src/libs/antares/study/study.cpp @@ -187,26 +187,6 @@ void Study::reduceMemoryUsage() ClearAndShrink(bufferLoadingTS); } -// TODO remove with GUI -uint64_t Study::memoryUsage() const -{ - return buffer.capacity() // Folders paths - + dataBuffer.capacity() - + bufferLoadingTS.capacity() - // Simulation - + simulationComments.memoryUsage() - // parameters - + parameters.memoryUsage() - // Areas - + areas.memoryUsage() - // Binding constraints - + bindingConstraints.memoryUsage() - // Correlations matrices - + preproLoadCorrelation.memoryUsage() + preproSolarCorrelation.memoryUsage() - + preproHydroCorrelation.memoryUsage() + preproWindCorrelation.memoryUsage() - + (uiinfo ? uiinfo->memoryUsage() : 0); -} - unsigned Study::getNumberOfCoresPerMode(unsigned nbLogicalCores, int ncMode) { if (!nbLogicalCores) diff --git a/src/libs/antares/study/ui-runtimeinfos.cpp b/src/libs/antares/study/ui-runtimeinfos.cpp index 5140656226..de042cc785 100644 --- a/src/libs/antares/study/ui-runtimeinfos.cpp +++ b/src/libs/antares/study/ui-runtimeinfos.cpp @@ -143,11 +143,6 @@ void UIRuntimeInfo::reloadBindingConstraints() } } -uint64_t UIRuntimeInfo::memoryUsage() const -{ - return sizeof(UIRuntimeInfo) + sizeof(AreaLink*) * pLink.size(); -} - uint UIRuntimeInfo::countItems(BindingConstraint::Operator op, BindingConstraint::Type type) { ByOperatorAndType::const_iterator i = byOperator.find(op); diff --git a/src/solver/simulation/include/antares/solver/simulation/solver.hxx b/src/solver/simulation/include/antares/solver/simulation/solver.hxx index 7f4a63ab82..7a47a75e69 100644 --- a/src/solver/simulation/include/antares/solver/simulation/solver.hxx +++ b/src/solver/simulation/include/antares/solver/simulation/solver.hxx @@ -280,8 +280,6 @@ void ISimulation::run() // Memory usage { - logs.info() << " Variables: (" - << (uint)(ImplementationType::variables.memoryUsage() / 1024 / 1024) << "Mo)"; Variable::PrintInfosStdCout c; ImplementationType::variables.template provideInformations(c); } diff --git a/src/solver/ts-generator/include/antares/solver/ts-generator/prepro.h b/src/solver/ts-generator/include/antares/solver/ts-generator/prepro.h index 850463b580..ff3416bb67 100644 --- a/src/solver/ts-generator/include/antares/solver/ts-generator/prepro.h +++ b/src/solver/ts-generator/include/antares/solver/ts-generator/prepro.h @@ -95,11 +95,6 @@ class PreproAvailability */ bool saveToFolder(const AnyString& folder) const; - /*! - ** \brief Get the amount of memory used by the class - */ - uint64_t memoryUsage() const; - /*! ** \brief Normalize NPO max and check for consistency ** diff --git a/src/solver/ts-generator/prepro.cpp b/src/solver/ts-generator/prepro.cpp index b26faefb50..943527c8e7 100644 --- a/src/solver/ts-generator/prepro.cpp +++ b/src/solver/ts-generator/prepro.cpp @@ -155,11 +155,6 @@ void PreproAvailability::markAsModified() const data.markAsModified(); } -uint64_t PreproAvailability::memoryUsage() const -{ - return sizeof(PreproAvailability); -} - void PreproAvailability::reset() { data.reset(preproAvailabilityMax, DAYS_PER_YEAR, true); diff --git a/src/solver/variable/include/antares/solver/variable/area.h b/src/solver/variable/include/antares/solver/variable/area.h index 9328c27ba8..3f380a0941 100644 --- a/src/solver/variable/include/antares/solver/variable/area.h +++ b/src/solver/variable/include/antares/solver/variable/area.h @@ -163,8 +163,6 @@ class Areas //: public Variable::IVariable, NextT, VCardAllAreas> void beforeYearByYearExport(uint year, uint numSpace); - uint64_t memoryUsage() const; - template static void provideInformations(I& infos); diff --git a/src/solver/variable/include/antares/solver/variable/area.hxx b/src/solver/variable/include/antares/solver/variable/area.hxx index d3b34bb973..60028d1a85 100644 --- a/src/solver/variable/include/antares/solver/variable/area.hxx +++ b/src/solver/variable/include/antares/solver/variable/area.hxx @@ -538,19 +538,6 @@ void Areas::beforeYearByYearExport(uint year, uint numSpace) pAreas[i].beforeYearByYearExport(year, numSpace); } } - -template -uint64_t Areas::memoryUsage() const -{ - uint64_t result = 0; - for (unsigned int i = 0; i != pAreaCount; ++i) - { - result += sizeof(NextType) + sizeof(void*); // overhead vector - result += pAreas[i].memoryUsage(); - } - return result; -} - } // namespace Variable } // namespace Solver } // namespace Antares diff --git a/src/solver/variable/include/antares/solver/variable/bindConstraints.h b/src/solver/variable/include/antares/solver/variable/bindConstraints.h index b10d7e9186..9bf44dd85e 100644 --- a/src/solver/variable/include/antares/solver/variable/bindConstraints.h +++ b/src/solver/variable/include/antares/solver/variable/bindConstraints.h @@ -152,8 +152,6 @@ class BindingConstraints int precision, uint numSpace) const; - uint64_t memoryUsage() const; - template void yearEndSpatialAggregates(V&, uint, uint) { diff --git a/src/solver/variable/include/antares/solver/variable/bindConstraints.hxx b/src/solver/variable/include/antares/solver/variable/bindConstraints.hxx index 63738c4f5c..f1824c67da 100644 --- a/src/solver/variable/include/antares/solver/variable/bindConstraints.hxx +++ b/src/solver/variable/include/antares/solver/variable/bindConstraints.hxx @@ -234,18 +234,6 @@ void BindingConstraints::hourEnd(State& state, uint hourInTheYear) } } -template -uint64_t BindingConstraints::memoryUsage() const -{ - uint64_t result = 0; - for (unsigned int i = 0; i != pBCcount; ++i) - { - result += sizeof(NextType) + sizeof(void*); // overhead vector - result += pBindConstraints[i].memoryUsage(); - } - return result; -} - template void BindingConstraints::weekForEachArea(State& state, unsigned int numSpace) { diff --git a/src/solver/variable/include/antares/solver/variable/commons/join.h b/src/solver/variable/include/antares/solver/variable/commons/join.h index 37f048ec83..09d067a97a 100644 --- a/src/solver/variable/include/antares/solver/variable/commons/join.h +++ b/src/solver/variable/include/antares/solver/variable/commons/join.h @@ -326,11 +326,6 @@ class Join: public Variable::IVariable, Yuni::Default, VCard RightType::template simulationEndSpatialAggregates(allVars); } - uint64_t memoryUsage() const - { - return LeftType::memoryUsage() + RightType::memoryUsage(); - } - template static void provideInformations(I& infos) { diff --git a/src/solver/variable/include/antares/solver/variable/commons/links/links.h b/src/solver/variable/include/antares/solver/variable/commons/links/links.h index eff3b7d09d..f7b29c6fd0 100644 --- a/src/solver/variable/include/antares/solver/variable/commons/links/links.h +++ b/src/solver/variable/include/antares/solver/variable/commons/links/links.h @@ -174,8 +174,6 @@ class Links void beforeYearByYearExport(uint year, uint numSpace); - uint64_t memoryUsage() const; - void buildDigest(SurveyResults& results, int digestLevel, int dataLevel) const; template diff --git a/src/solver/variable/include/antares/solver/variable/commons/links/links.hxx b/src/solver/variable/include/antares/solver/variable/commons/links/links.hxx index d56090f7d3..00ba05bbe4 100644 --- a/src/solver/variable/include/antares/solver/variable/commons/links/links.hxx +++ b/src/solver/variable/include/antares/solver/variable/commons/links/links.hxx @@ -348,18 +348,6 @@ void Links::RetrieveVariableList(PredicateT& predicate) NextType::RetrieveVariableList(predicate); } -template -inline uint64_t Links::memoryUsage() const -{ - uint64_t result = 0; - for (uint i = 0; i != pLinkCount; ++i) - { - result += sizeof(NextType) + sizeof(void*); - result += pLinks[i].memoryUsage(); - } - return result; -} - template Links::~Links() { diff --git a/src/solver/variable/include/antares/solver/variable/container.h b/src/solver/variable/include/antares/solver/variable/container.h index 94a3997b79..23938f71f1 100644 --- a/src/solver/variable/include/antares/solver/variable/container.h +++ b/src/solver/variable/include/antares/solver/variable/container.h @@ -220,12 +220,6 @@ class List: public NextT void buildDigest(SurveyResults& results, int digestLevel, int dataLevel) const; //@} - //! \name Memory management - //@{ - //! Get the amount of memory currently used by the class - uint64_t memoryUsage() const; - //@} - private: //! Pointer to the current study Data::Study* pStudy; diff --git a/src/solver/variable/include/antares/solver/variable/container.hxx b/src/solver/variable/include/antares/solver/variable/container.hxx index 0f9559b3a2..2435a2ef8d 100644 --- a/src/solver/variable/include/antares/solver/variable/container.hxx +++ b/src/solver/variable/include/antares/solver/variable/container.hxx @@ -237,12 +237,6 @@ inline void List::retrieveResultsForLink( NextType::template retrieveResultsForLink(result, link); } -template -inline uint64_t List::memoryUsage() const -{ - return sizeof(ListType) + NextType::memoryUsage(); -} - template void List::buildSurveyReport(SurveyResults& results, int dataLevel, diff --git a/src/solver/variable/include/antares/solver/variable/economy/STSbyGroup.h b/src/solver/variable/include/antares/solver/variable/economy/STSbyGroup.h index 4e3ad6ee7c..5ea9c01af4 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/STSbyGroup.h +++ b/src/solver/variable/include/antares/solver/variable/economy/STSbyGroup.h @@ -337,15 +337,6 @@ class STSbyGroup: public Variable::IVariable, NextT, VCardSTSb return pValuesForTheCurrentYear[numSpace][column].hour; } - inline uint64_t memoryUsage() const - { - uint64_t r = (sizeof(IntermediateValues) * nbColumns_ + IntermediateValues::MemoryUsage()) - * pNbYearsParallel; - r += sizeof(double) * nbColumns_ * HOURS_PER_YEAR * pNbYearsParallel; - r += AncestorType::memoryUsage(); - return r; - } - std::string caption(unsigned int column) const { static const std::vector VAR_POSSIBLE_KINDS = {"INJECTION", diff --git a/src/solver/variable/include/antares/solver/variable/economy/STStorageCashFlowByCluster.h b/src/solver/variable/include/antares/solver/variable/economy/STStorageCashFlowByCluster.h index eb2eaa48b9..9893049943 100644 --- a/src/solver/variable/include/antares/solver/variable/economy/STStorageCashFlowByCluster.h +++ b/src/solver/variable/include/antares/solver/variable/economy/STStorageCashFlowByCluster.h @@ -259,15 +259,6 @@ class STstorageCashFlowByCluster: public Variable::IVariable static void provideInformations(I&) { diff --git a/src/solver/variable/include/antares/solver/variable/info.h b/src/solver/variable/include/antares/solver/variable/info.h index 39c6a43e42..2eaa3df68f 100644 --- a/src/solver/variable/include/antares/solver/variable/info.h +++ b/src/solver/variable/include/antares/solver/variable/info.h @@ -162,16 +162,6 @@ struct VariableAccessor } } - static uint64_t Value(const Type& container) - { - uint64_t result = 0; - for (uint i = 0; i != ColumnCountT; ++i) - { - result += container[i].memoryUsage(); - } - return result; - } - template static void BuildDigest(SurveyResults& results, const Type& container, @@ -383,17 +373,6 @@ struct VariableAccessor } } - static uint64_t Value(const Type& container) - { - uint64_t result = 0; - const typename Type::const_iterator end = container.end(); - for (typename Type::const_iterator i = container.begin(); i != end; ++i) - { - result += sizeof(ResultsT) + (*i).memoryUsage(); - } - return result; - } - template static void BuildDigest(SurveyResults& results, const Type& container, @@ -620,11 +599,6 @@ struct VariableAccessor container.merge(year, intermediateValues); } - static uint64_t Value(const Type& container) - { - return container.memoryUsage(); - } - template static void BuildDigest(SurveyResults& results, const Type& container, diff --git a/src/solver/variable/include/antares/solver/variable/setofareas.h b/src/solver/variable/include/antares/solver/variable/setofareas.h index 1263b986f3..74c68528ba 100644 --- a/src/solver/variable/include/antares/solver/variable/setofareas.h +++ b/src/solver/variable/include/antares/solver/variable/setofareas.h @@ -161,8 +161,6 @@ class SetsOfAreas void beforeYearByYearExport(uint year, uint numSpace); - uint64_t memoryUsage() const; - template static void provideInformations(I& infos); diff --git a/src/solver/variable/include/antares/solver/variable/setofareas.hxx b/src/solver/variable/include/antares/solver/variable/setofareas.hxx index 630ded8903..19e60f2997 100644 --- a/src/solver/variable/include/antares/solver/variable/setofareas.hxx +++ b/src/solver/variable/include/antares/solver/variable/setofareas.hxx @@ -266,17 +266,6 @@ void SetsOfAreas::buildDigest(SurveyResults& results, int digestLevel, in } } -template -inline uint64_t SetsOfAreas::memoryUsage() const -{ - uint64_t result = sizeof(NextType) * pSetsOfAreas.size(); - for (auto i = pBegin; i != pEnd; ++i) - { - result += (*i)->memoryUsage(); - } - return result; -} - template template inline void SetsOfAreas::provideInformations(I& infos) diff --git a/src/solver/variable/include/antares/solver/variable/storage/average.h b/src/solver/variable/include/antares/solver/variable/storage/average.h index fbeaf16a5b..43718fd4ca 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/average.h +++ b/src/solver/variable/include/antares/solver/variable/storage/average.h @@ -161,11 +161,6 @@ struct Average: public NextT NextType::template buildDigest(report, digestLevel, dataLevel); } - uint64_t memoryUsage() const - { - return avgdata.dynamicMemoryUsage() + NextType::memoryUsage(); - } - template class DecoratorT> Antares::Memory::Stored::ConstReturnType hourlyValuesForSpatialAggregate() const { diff --git a/src/solver/variable/include/antares/solver/variable/storage/averagedata.h b/src/solver/variable/include/antares/solver/variable/storage/averagedata.h index 132b70317d..57c03820b5 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/averagedata.h +++ b/src/solver/variable/include/antares/solver/variable/storage/averagedata.h @@ -52,11 +52,6 @@ class AverageData void merge(unsigned int year, const IntermediateValues& rhs); - uint64_t dynamicMemoryUsage() const - { - return sizeof(double) * HOURS_PER_YEAR + sizeof(double) * nbYearsCapacity; - } - public: double monthly[MONTHS_PER_YEAR]; double weekly[WEEKS_PER_YEAR]; diff --git a/src/solver/variable/include/antares/solver/variable/storage/empty.h b/src/solver/variable/include/antares/solver/variable/storage/empty.h index 354c0f4545..747f87ae2f 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/empty.h +++ b/src/solver/variable/include/antares/solver/variable/storage/empty.h @@ -71,11 +71,6 @@ struct Empty // Does nothing } - static uint64_t memoryUsage() - { - return 0; - } - template class DecoratorT> static Antares::Memory::Stored::ConstReturnType hourlyValuesForSpatialAggregate() { diff --git a/src/solver/variable/include/antares/solver/variable/storage/intermediate.h b/src/solver/variable/include/antares/solver/variable/storage/intermediate.h index e7c1757c62..661baf7eaa 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/intermediate.h +++ b/src/solver/variable/include/antares/solver/variable/storage/intermediate.h @@ -49,11 +49,6 @@ class IntermediateValues final typedef double Type; public: - //! Get the dynamic amount of memory consummed by a simulation - // \note This method assumes that you've already have gathered the size - // of this class - static uint64_t MemoryUsage(); - //! \name Constructor & Destructor //@{ /*! diff --git a/src/solver/variable/include/antares/solver/variable/storage/intermediate.hxx b/src/solver/variable/include/antares/solver/variable/storage/intermediate.hxx index 9dd74a235a..78a1806ede 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/intermediate.hxx +++ b/src/solver/variable/include/antares/solver/variable/storage/intermediate.hxx @@ -53,11 +53,6 @@ inline const IntermediateValues::Type& IntermediateValues::operator[]( return hour[index]; } -inline uint64_t IntermediateValues::MemoryUsage() -{ - return +sizeof(Type) * HOURS_PER_YEAR; -} - template inline void IntermediateValues::buildAnnualSurveyReport(SurveyResults& report, int fileLevel, diff --git a/src/solver/variable/include/antares/solver/variable/storage/minmax.h b/src/solver/variable/include/antares/solver/variable/storage/minmax.h index 6095863374..4d8c210435 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/minmax.h +++ b/src/solver/variable/include/antares/solver/variable/storage/minmax.h @@ -143,11 +143,6 @@ struct MinMaxBase: public NextT void merge(uint year, const IntermediateValues& rhs); - uint64_t memoryUsage() const - { - return sizeof(double) * HOURS_PER_YEAR + NextType::memoryUsage(); - } - template class DecoratorT> Antares::Memory::Stored::ConstReturnType hourlyValuesForSpatialAggregate() const { diff --git a/src/solver/variable/include/antares/solver/variable/storage/raw.h b/src/solver/variable/include/antares/solver/variable/storage/raw.h index fe6c444840..0d2cf279fc 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/raw.h +++ b/src/solver/variable/include/antares/solver/variable/storage/raw.h @@ -159,11 +159,6 @@ struct Raw: public NextT NextType::template buildDigest(report, digestLevel, dataLevel); } - uint64_t memoryUsage() const - { - return +sizeof(double) * HOURS_PER_YEAR + NextType::memoryUsage(); - } - template class DecoratorT> Antares::Memory::Stored::ConstReturnType hourlyValuesForSpatialAggregate() const { diff --git a/src/solver/variable/include/antares/solver/variable/storage/results.h b/src/solver/variable/include/antares/solver/variable/storage/results.h index e699d563e4..ddb809ce85 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/results.h +++ b/src/solver/variable/include/antares/solver/variable/storage/results.h @@ -91,11 +91,6 @@ class Results: public FirstDecoratorT DecoratorType::template buildDigest(results, digestLevel, dataLevel); } - uint64_t memoryUsage() const - { - return DecoratorType::memoryUsage(); - } - Antares::Memory::Stored::ConstReturnType hourlyValuesForSpatialAggregate() const { return DecoratorType::template hourlyValuesForSpatialAggregate< diff --git a/src/solver/variable/include/antares/solver/variable/storage/stdDeviation.h b/src/solver/variable/include/antares/solver/variable/storage/stdDeviation.h index 44159d9cba..ddda4cd3b5 100644 --- a/src/solver/variable/include/antares/solver/variable/storage/stdDeviation.h +++ b/src/solver/variable/include/antares/solver/variable/storage/stdDeviation.h @@ -179,11 +179,6 @@ struct StdDeviation: public NextT precision); } - uint64_t memoryUsage() const - { - return sizeof(double) * HOURS_PER_YEAR + NextType::memoryUsage(); - } - template class DecoratorT> Antares::Memory::Stored::ConstReturnType hourlyValuesForSpatialAggregate() const { diff --git a/src/solver/variable/include/antares/solver/variable/variable.h b/src/solver/variable/include/antares/solver/variable/variable.h index 279ba9da3d..4e986607d8 100644 --- a/src/solver/variable/include/antares/solver/variable/variable.h +++ b/src/solver/variable/include/antares/solver/variable/variable.h @@ -273,13 +273,6 @@ class IVariable: protected NextT void beforeYearByYearExport(uint year, uint numSpace); //@} - //! \name Misc - //@{ - /*! - ** \brief Get the memory used by this variable and all other in the static list - */ - uint64_t memoryUsage() const; - /*! ** \brief "Print" informations about the variable tree */ diff --git a/src/solver/variable/include/antares/solver/variable/variable.hxx b/src/solver/variable/include/antares/solver/variable/variable.hxx index 6b2ba73a55..ee031633f8 100644 --- a/src/solver/variable/include/antares/solver/variable/variable.hxx +++ b/src/solver/variable/include/antares/solver/variable/variable.hxx @@ -356,25 +356,6 @@ inline void IVariable::beforeYearByYearExport(uint year, NextType::beforeYearByYearExport(year, numspace); } -template -inline uint64_t IVariable::memoryUsage() const -{ - uint64_t r = VariableAccessorType::Value(pResults); - if (VCardT::columnCount != (int)Category::dynamicColumns) - { - // Intermediate values - if (VCardT::hasIntermediateValues) - { - for (uint i = 0; i != (uint)VCardT::columnCount; ++i) - { - r += IntermediateValues::MemoryUsage(); - } - } - } - r += NextType::memoryUsage(); - return r; -} - template template inline void IVariable::provideInformations(I& infos)