Skip to content

Conversation

ahejlsberg
Copy link
Member

The -diagnostics command line switch now includes memory usage in the reported statistics when running under node.js. If node.js was invoked with the -expose-gc flag, global.gc() is called before obtaining the allocated heap size to get a more accurate number. For example:

node -expose-gc tsc -diagnostics myProgram.ts

Note that memory usage is not reported with the cscript.exe host since it provides no way to obtain memory statistics.

@mhegazy
Copy link
Contributor

mhegazy commented Aug 14, 2014

👍

@DanielRosenwasser
Copy link
Member

getMemoryUsage returns 0 under WScript? This isn't documented well. I feel like we should either document the sentinel value (0 in this case, or potentially any negative value), or make getMemoryUsage an optional property that you check from sys, much like watchFile.

@vladima
Copy link
Contributor

vladima commented Aug 14, 2014

👍

@ahejlsberg
Copy link
Member Author

@DanielRosenwasser Yes, makes more sense for sys.getMemoryUsage to be optional.

ahejlsberg added a commit that referenced this pull request Aug 14, 2014
Include memory usage in -diagnostics report
@ahejlsberg ahejlsberg merged commit 2775fc2 into master Aug 14, 2014
@ahejlsberg ahejlsberg deleted the reportMemoryUsage branch August 14, 2014 20:11
@DanielRosenwasser
Copy link
Member

Thanks for addressing that! 👍

@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants