Thursday, October 6, 2016

High Physical Memory Usage Issue

Background

I investigated an issue where a new Hyper-V virtual machine running Windows 7 would consume most of the physical memory after exactly 5 minutes of uptime.  This would occur even if no applications were running.

Investigation

I tried using the Windows Task Manager "Processes" tab to look at the memory being used but none of the processes listed (mostly services) had anywhere close to the amount of physical memory (8 GB) allocated.

After some initial searching I found this great SysInternals utility called RAMMap: https://technet.microsoft.com/en-us/sysinternals/rammap.aspx

Running RAMMap utility indicated that most of the memory was "Driver Locked".  Using a Google search, I found this post: https://social.technet.microsoft.com/Forums/office/en-US/d4f97391-a70c-47b1-ab05-bab4754868ac/hyperv-dynamic-memory-driver-locked?forum=winserverhyperv

I found that the Windows 7 virtual machine was specified to use "Dynamic Memory".

Solution 

After shutting down the virtual machine, I unchecked the "Enable Dynamic Memory" option in the Memory Settings for the virtual machine and set the startup memory to my fixed size.  After restarting the virtual machine, I found that the physical memory usage no longer grew after 5 minutes.

Monday, October 3, 2016

Useful TypeScript Links

TypeScript is a strongly typed open source language which compiles into JavaScript. TypeScript was originally developed by Microsoft.  The language supports interfaces, classes (including inheritance), generics and modules.

Using TypeScript enables the developer to validate the code contracts at design/compile time instead of waiting until the code is executed in the browser.  This reduces your development and testing costs and results in a more reliable site.

This YouTube video provides a good introduction to the language including how to integrate jQuery with TypeScript: Getting Started with TypeScript

There is a browser based playground at: http://www.typescriptlang.org/Playground which you can use to try out the language.

Many TypeScript type definitions (which are very useful when incorporating other JavaScript frameworks such as jQuery) are available on github: https://github.com/DefinitelyTyped/DefinitelyTyped