Memory monitoring API
class CIDRSMemory
Section titled “class CIDRSMemory”The memory monitoring API is available in the class CIDRSMemory.
It gives you a way:
- to monitor the current memory consumption of the SDK
- to limit its maximum allowed consumption
Workflow example
Section titled “Workflow example”-
Call to
CIDRSMemory::ActivateMonitoring().
No module must be set up when the call is performed -
Optionally set a maximum memory limit via a call to
CIDRSMemory::SetMaxMemoryLimit().- the value 0 sets up the memory to unlimited (default value)
- this call can occur anytime in the workflow. If the memory consumption is already above the provided threshold, an exception is thrown directly after setting the max limit.
-
Perform iDRS setup via calls to
CIDRSSetup::SetupModule(). -
Process documents using the iDRS.
If the iDRS memory consumption is about to grow over the max limit, then the allocation is denied and an exception is thrown. -
At any time during processing, you can call the methods
CIDRSMemory::GetCurrentMemoryConsumption()and/orCIDRSMemory::GetPeakMemoryConsumption()to monitor the current status of memory usage. -
At application teardown, call
CIDRSSetup::Unload().
All iDRS object instances must be out-of-scope before this last call.
Monitoring the memory comes with a small degradation in terms of speed performances. According to our testing, an average of +3% processing time is to be expected. However, as by default, the memory is not monitored, there is no impact if you are not interested in this feature.
Limitations
Section titled “Limitations”-
The current implementation does NOT monitor memory consumption of the following components:
- Barcode engine libraries
- Third-party libraries invoked to load PDF documents