Skip to content

Commit

Permalink
Reformat files with trailing spaces, see phetsims/chipper#734
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Sep 28, 2019
1 parent 18e6b6a commit c40a7fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion js/KebabMenuIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ define( require => {
}

return joist.register( 'KebabMenuIcon', KebabMenuIcon );
} );
} );
8 changes: 4 additions & 4 deletions js/MemoryMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ define( require => {

// constants
const MB = 1024 * 1024;

// globals
let hadMemoryFailure = false;

Expand Down Expand Up @@ -49,18 +49,18 @@ define( require => {
if ( !window.performance || !window.performance.memory || !window.performance.memory.usedJSHeapSize ) {
return;
}

const currentMemory = window.performance.memory.usedJSHeapSize;
this.lastMemory = currentMemory;
const averageMemory = this.runningAverage.updateRunningAverage( currentMemory );

if ( this.memoryLimit &&
this.runningAverage.isSaturated() &&
!hadMemoryFailure &&
!hadMemoryFailure &&
averageMemory > this.memoryLimit &&
currentMemory > this.memoryLimit * 0.5 ) {
hadMemoryFailure = true;
throw new Error( 'Average memory used (' + MemoryMonitor.memoryString( averageMemory ) + ') is above our memoryLimit (' + MemoryMonitor.memoryString( this.memoryLimit ) + '). Current memory: ' + MemoryMonitor.memoryString( currentMemory ) + '.' );
throw new Error( 'Average memory used (' + MemoryMonitor.memoryString( averageMemory ) + ') is above our memoryLimit (' + MemoryMonitor.memoryString( this.memoryLimit ) + '). Current memory: ' + MemoryMonitor.memoryString( currentMemory ) + '.' );
}
}

Expand Down

0 comments on commit c40a7fb

Please sign in to comment.