Edit in JSFiddle

window.onload = function()
{
    if("performance" in window)
    {
        if("memory" in window.performance)
        {
            document.getElementById("result").innerHTML = "Page Performance API and Memory Profiling API is supported";
            document.getElementById("heap_size_limit").innerHTML = "Heap size limit: " + window.performance.memory.jsHeapSizeLimit + " bytes";
            document.getElementById("total_heap_size").innerHTML = "Total heap size of this page: " + window.performance.memory.totalJSHeapSize + " bytes";
            document.getElementById("used_heap_size").innerHTML = "Used heap size: " + window.performance.memory.usedJSHeapSize + " bytes";
        }
        else
        {
            document.getElementById("result").innerHTML = "Memory Profiling API is not supported by this browser";  
        }
    }
    else
    {
         document.getElementById("result").innerHTML = "Page Performance API is not supported";   
    }
}
<div id="result"></div>
<div id="heap_size_limit"></div>
<div id="total_heap_size"></div>
<div id="used_heap_size"></div>