I thought I'd add a quick code snippet here to reflect the JavaScript part of the question:
Keep in mind this is only here as a jump-start for anyone trying to get a memory report for your app as it's running from within JS. This is only example code and not terribly fault-tolerant.
Windows.System.AppDiagnosticInfo.requestInfoAsync().then((allProc) => {
let proc = allProc[0];
let allGroups = proc.getResourceGroups();
let procGroup = allGroups[0];
let memReport = procGroup.getMemoryReport();
console.log(memReport);
console.log(
` [${memReport.commitUsageLevel}] : commitUsageLevel \n` +
` [${memReport.commitUsageLimit}] : commitUsageLimit \n` +
` [${memReport.privateCommitUsage}] : privateCommitUsage \n` +
` [${memReport.totalCommitUsage}] : totalCommitUsage \n`
)
});