model/consoleState.js
function() {
        if (process.platform !== 'win32') {
            return;
        }

        var id = $$persistence.processId();
        if (id) {
            child_process.exec('tasklist /FI "PID eq ' + id + '" /FO LIST', _.bind(function(error, stdout, stderror) {
                /*
                // tasklist.exe output looks like this:
                Image Name:   Client.exe
                PID:          12008
                Session Name: Console
                Session#:     1
                Mem Usage:    39,384 K
                */

                stdout = stdout.toString();
                var match = XRegExp.exec(stdout, XRegExp('[\\d,]+\\sK'));
                if (!match) {
                    return;
                }

                match = match[0]; // "39,384 K"
                match = match.replace(',', '').replace(' K', ''); // "39384"
                var memory = parseInt(match) * 1024; // 40329216
                this._memoryFrame(memory);

                clearTimeout(this._updateMemoryWinTimeout);
                this._updateMemoryWinTimeout = setTimeout(_.bind(this._updateMemoryWin, this), this._updateStatsRate);

                $$persistence.checkMemory(memory);
            }, this));
        } else {
            clearTimeout(this._updateMemoryWinTimeout);
            this._updateMemoryWinTimeout = setTimeout(_.bind(this._updateMemoryWin, this), this._updateStatsRate);
        }
    }
function() {
        if (process.platform !== 'win32') {
            return;
        }

        var id = $$persistence.processId();
        if (id) {
            child_process.exec('tasklist /FI "PID eq ' + id + '" /FO LIST', _.bind(function(error, stdout, stderror) {
                /*
                // tasklist.exe output looks like this:
                Image Name:   Client.exe
                PID:          12008
                Session Name: Console
                Session#:     1
                Mem Usage:    39,384 K
                */

                stdout = stdout.toString();
                var match = XRegExp.exec(stdout, XRegExp('[\\d,]+\\sK'));
                if (!match) {
                    return;
                }

                match = match[0]; // "39,384 K"
                match = match.replace(',', '').replace(' K', ''); // "39384"
                var memory = parseInt(match) * 1024; // 40329216
                this._memoryFrame(memory);

                clearTimeout(this._updateMemoryWinTimeout);
                this._updateMemoryWinTimeout = setTimeout(_.bind(this._updateMemoryWin, this), this._updateStatsRate);

                $$persistence.checkMemory(memory);
            }, this));
        } else {
            clearTimeout(this._updateMemoryWinTimeout);
            this._updateMemoryWinTimeout = setTimeout(_.bind(this._updateMemoryWin, this), this._updateStatsRate);
        }
    }
function ( ) { if ( process . platform !== 'win32' ) { return ; } var id = $$persistence . processId ( ) ; if ( id ) { child_process . exec ( 'tasklist /FI "PID eq ' + id + '" /FO LIST' , _ . bind ( function ( error , stdout , stderror ) { /*
                // tasklist.exe output looks like this:
                Image Name:   Client.exe
                PID:          12008
                Session Name: Console
                Session#:     1
                Mem Usage:    39,384 K
                */ stdout = stdout . toString ( ) ; var match = XRegExp . exec ( stdout , XRegExp ( '[\\d,]+\\sK' ) ) ; if ( ! match ) { return ; } match = match [ 0 ] ; // "39,384 K" match = match . replace ( ',' , '' ) . replace ( ' K' , '' ) ; // "39384" var memory = parseInt ( match ) * 1024 ; // 40329216 this . _memoryFrame ( memory ) ; clearTimeout ( this . _updateMemoryWinTimeout ) ; this . _updateMemoryWinTimeout = setTimeout ( _ . bind ( this . _updateMemoryWin , this ) , this . _updateStatsRate ) ; $$persistence . checkMemory ( memory ) ; } , this ) ) ; } else { clearTimeout ( this . _updateMemoryWinTimeout ) ; this . _updateMemoryWinTimeout = setTimeout ( _ . bind ( this . _updateMemoryWin , this ) , this . _updateStatsRate ) ; } }
Request to update the memory.
Request to update the memory .