Angular Modernizer
    Preparing search index...

    Real-time memory monitor for Promise-based parallelism

    Safety net for medium-complexity projects (score 35-65) that run in Promise mode, to prevent V8 heap exhaustion.

    Monitors heap usage and projects peak memory to prevent crashes. Aborts execution if projected peak exceeds critical threshold (85%).

    Algorithm:

    1. Check memory every 5 seconds
    2. Calculate average memory per file: heapUsed / filesProcessed
    3. Project peak: memoryPerFile × totalFiles
    4. If projected peak > 85% heap limit: abort and suggest workers

    Thresholds:

    • Warning (70%): Log warning but continue
    • Critical (85%): Abort and throw error

    The WorkerPool analysis path is deprecated since 1.1 and will be removed in 2.0; the MCP scans run in a scan worker instead.

    Index

    Constructors

    Methods

    • Check if monitoring has detected critical issues

      Returns boolean

      True if aborted due to critical memory pressure

    • Start monitoring

      Parameters

      • totalFiles: number

        Total number of files to process

      Returns void

    • Stop monitoring (success)

      Returns void

    • Update progress (called by ParallelExecutor)

      Parameters

      • filesProcessed: number

        Number of files processed so far

      Returns void