The two main resources that programs consume are CPU cycles and memory. Just as we can profile CPU usage to determine which parts of our programs use the most CPU cycles, we can also profile memory usage to determine which parts of our program use the most memory. We can also use memory profiling to track down memory “leaks”.