DDD  1.9.0.20240425101308
Static Public Member Functions | Private Types | Static Private Attributes | List of all members
MemoryManager Class Reference

This class defines a few utility functions common to DDD. More...

#include <MemoryManager.h>

Collaboration diagram for MemoryManager:
Collaboration graph

Static Public Member Functions

static unsigned int nbDDD ()
 Returns the size of the unicity table for DDD. More...
 
static unsigned int nbDED ()
 Returns the size of the cache unicity table for DDD. More...
 
static unsigned int nbHom ()
 Returns the size of the unicity table for DDD Homomorphisms. More...
 
static unsigned int nbSDD ()
 Returns the size of the unicity table for SDD. More...
 
static unsigned int nbSDED ()
 Returns the size of the cache unicity table for SDD. More...
 
static unsigned int nbShom ()
 Returns the size of the unicity table for SDD Homomorphisms. More...
 
static void mark (const GDDD &g)
 Convenience function to mark a node as non collectible. More...
 
static void mark (const GHom &h)
 Convenience function to mark a Hom as non collectible. More...
 
static bool should_garbage ()
 tester for memory management routine triggering in a top level fixpoint More...
 
static void garbage ()
 Garbage collection function. More...
 
static void pstats (bool reinit=true)
 Prints some statistics about use of unicity tables, also reinitializes peak sizes. More...
 
static void setGCThreshold (size_t nbKbyte)
 
static size_t getPeakMemory ()
 
static void addHook (GCHook *hook)
 

Private Types

typedef std::vector< GCHook * > hooks_t
 
typedef hooks_t::iterator hooks_it
 

Static Private Attributes

static hooks_t hooks_ = MemoryManager::hooks_t()
 
static size_t last_mem = 1300000
 

Detailed Description

This class defines a few utility functions common to DDD.

Note that all functions are declared static, so this is more of a namespace than a class. One important function is garbage(), only this MemoryManager::garbage() should be caled : avoid GHom::garbage(), DED::garbage(), GDDD::garbage() (and SDD versions of the same, they should not be called directly.

Member Typedef Documentation

◆ hooks_it

typedef hooks_t::iterator MemoryManager::hooks_it
private

◆ hooks_t

typedef std::vector<GCHook*> MemoryManager::hooks_t
private

Member Function Documentation

◆ addHook()

static void MemoryManager::addHook ( GCHook hook)
inlinestatic

References hooks_.

◆ garbage()

static void MemoryManager::garbage ( )
inlinestatic

Garbage collection function.

Call this to reclaim intermediate nodes, unused operations and related cache. Note that this function is quite costly, and it totally destroys the cache

References GDDD::garbage(), DED::garbage(), GHom::garbage(), IntDataSet::garbage(), MLHom::garbage(), GSDD::garbage(), SDED::garbage(), GShom::garbage(), and hooks_.

Referenced by Fixpoint::eval(), and sns::Fixpoint::eval().

◆ getPeakMemory()

static size_t MemoryManager::getPeakMemory ( )
inlinestatic

References last_mem, and should_garbage().

◆ mark() [1/2]

static void MemoryManager::mark ( const GDDD g)
inlinestatic

Convenience function to mark a node as non collectible.

Todo:
: track usage and check whether this is useful, SDD version undefined.

References GDDD::mark().

◆ mark() [2/2]

static void MemoryManager::mark ( const GHom h)
inlinestatic

Convenience function to mark a Hom as non collectible.

Todo:
: track usage and check whether this is useful, SDD version undefined.

References GHom::mark().

◆ nbDDD()

static unsigned int MemoryManager::nbDDD ( )
inlinestatic

Returns the size of the unicity table for DDD.

References GDDD::statistics().

◆ nbDED()

static unsigned int MemoryManager::nbDED ( )
inlinestatic

Returns the size of the cache unicity table for DDD.

References DED::statistics().

◆ nbHom()

static unsigned int MemoryManager::nbHom ( )
inlinestatic

Returns the size of the unicity table for DDD Homomorphisms.

References GHom::statistics().

◆ nbSDD()

static unsigned int MemoryManager::nbSDD ( )
inlinestatic

Returns the size of the unicity table for SDD.

References GSDD::statistics().

◆ nbSDED()

static unsigned int MemoryManager::nbSDED ( )
inlinestatic

Returns the size of the cache unicity table for SDD.

References SDED::statistics().

◆ nbShom()

static unsigned int MemoryManager::nbShom ( )
inlinestatic

Returns the size of the unicity table for SDD Homomorphisms.

References GShom::statistics().

◆ pstats()

static void MemoryManager::pstats ( bool  reinit = true)
inlinestatic

Prints some statistics about use of unicity tables, also reinitializes peak sizes.

References GDDD::pstats(), DED::pstats(), GHom::pstats(), GSDD::pstats(), SDED::pstats(), and GShom::pstats().

◆ setGCThreshold()

static void MemoryManager::setGCThreshold ( size_t  nbKbyte)
inlinestatic

References last_mem.

◆ should_garbage()

static bool MemoryManager::should_garbage ( )
inlinestatic

tester for memory management routine triggering in a top level fixpoint

References process::getResidentMemory(), and last_mem.

Referenced by Fixpoint::eval(), sns::Fixpoint::eval(), and getPeakMemory().

Member Data Documentation

◆ hooks_

MemoryManager::hooks_t MemoryManager::hooks_ = MemoryManager::hooks_t()
staticprivate

Referenced by addHook(), and garbage().

◆ last_mem

size_t MemoryManager::last_mem = 1300000
staticprivate

The documentation for this class was generated from the following files:

Please comment this page and report errors about it on the RefDocComments page.
Generated on Thu Apr 25 2024 10:15:16 for DDD by doxygen 1.9.1