         
         return data
     }
-
-    
-    // TODO: can we get this for 3 time ranges?
-    public func machFactor() -> Double {
-        return Double(loadInfo().mach_factor) / Double(LOAD_SCALE)
+    
+    
+    //--------------------------------------------------------------------------
+    // MARK: PUBLIC METHODS - MEMORY
+    //--------------------------------------------------------------------------
+    
+    
+    public func vmStatistics() -> vm_statistics {
+        var size = HOST_VM_INFO_COUNT
+        var hi = host_info_t.alloc(Int(HOST_VM_INFO_COUNT))
+        hi.initialize(0)
+        
+        let result = host_statistics(mach_host_self(), HOST_VM_INFO, hi, &size)
+        
+        if (result != KERN_SUCCESS) {
+            println("ERROR: \(__FUNCTION__) - \(result)")
+            return vm_statistics(free_count: 0,
+                                 active_count: 0,
+                                 inactive_count: 0,
+                                 wire_count: 0,
+                                 zero_fill_count: 0,
+                                 reactivations: 0,
+                                 pageins: 0,
+                                 pageouts: 0,
+                                 faults: 0,
+                                 cow_faults: 0,
+                                 lookups: 0,
+                                 hits: 0,
+                                 purgeable_count: 0,
+                                 purges: 0,
+                                 speculative_count: 0)
+        }
+        
+        let data = UnsafePointer<vm_statistics>(hi).memory
+        
+        hi.dealloc(Int(HOST_VM_INFO_COUNT))
+        
+        return data
+    }
+    
+    
+    public func vmStatistics64() -> vm_statistics64 {
+        // Swift runs on 10.9 and above, and 10.9 is x86_64 only. On iOS though
+        // its 7 and above, with both ARM & ARM64
+        // TODO: Does iOS 32-bit have supported for commpressed memory?
+        // TODO: For now we have two methods, but we could use arch macros
+        
+        var size = HOST_VM_INFO64_COUNT
+        var hi = host_info_t.alloc(Int(HOST_VM_INFO64_COUNT))
+        hi.initialize(0)
+        
+        let result = host_statistics64(mach_host_self(), HOST_VM_INFO64, hi, &size)
+        
+        if (result != KERN_SUCCESS) {
+            println("ERROR: \(__FUNCTION__) - \(result)")
+            return vm_statistics64(free_count: 0,
+                                   active_count: 0,
+                                   inactive_count: 0,
+                                   wire_count: 0,
+                                   zero_fill_count: 0,
+                                   reactivations: 0,
+                                   pageins: 0,
+                                   pageouts: 0,
+                                   faults: 0,
+                                   cow_faults: 0,
+                                   lookups: 0,
+                                   hits: 0,
+                                   purges: 0,
+                                   purgeable_count: 0,
+                                   speculative_count: 0,
+                                   decompressions: 0,
+                                   compressions: 0,
+                                   swapins: 0,
+                                   swapouts: 0,
+                                   compressor_page_count: 0,
+                                   throttled_count: 0,
+                                   external_page_count: 0,
+                                   internal_page_count: 0,
+                                   total_uncompressed_pages_in_compressor: 0)
+        }
+        
+        let data = UnsafePointer<vm_statistics64>(hi).memory
+        
+        hi.dealloc(Int(HOST_VM_INFO64_COUNT))
+        
+        return data
+    }
+    
+    
+    public func memoryUsage() -> (freem: Double, active: Double, inactive: Double, wired: Double, compressed: Double) {
+        let stats = vmStatistics64()
+        
+        let freem = Double(stats.free_count) * Double(vm_kernel_page_size) / Double(Unit.Gigabyte.rawValue)
+        let active = Double(stats.active_count) * Double(vm_kernel_page_size) / Double(Unit.Gigabyte.rawValue)
+        let inactive = Double(stats.inactive_count) * Double(vm_kernel_page_size) / Double(Unit.Gigabyte.rawValue)
+        let wired = Double(stats.wire_count) * Double(vm_kernel_page_size) / Double(Unit.Gigabyte.rawValue)
+        
+        // Data size that was compressed
+        let compressed = Double(stats.compressions) * Double(vm_kernel_page_size) / Double(Unit.Gigabyte.rawValue)
+        
+        // Result of the compression
+        // This is what you see in Activity Monitor
+        let compressed_result = Double(stats.compressor_page_count) * Double(vm_kernel_page_size) / Double(Unit.Gigabyte.rawValue)
+        
+        return (freem, active, inactive, wired, compressed_result)
     }
 }
    
    
    public func loadInfo() -> processor_set_load_info {
        var count = PROCESSOR_SET_LOAD_INFO_COUNT
        var info_out = processor_set_info_t.alloc(
                                             Int(PROCESSOR_SET_LOAD_INFO_COUNT))

    
    TODO: Can deinit do this?
    */
//    public func fini() -> kern_return_t {
//        return mach_port_deallocate(mach_task_self_, host)
//    }
    
    
    //--------------------------------------------------------------------------
    // MARK: PUBLIC METHODS - CPU
    //--------------------------------------------------------------------------
    
    
    public func hostBasicInfo() -> host_basic_info {
