Correcting memory problems
This one can be immediately obvious or an exceedingly insidious bug to track down. If your app is allocating lots of memory quickly and not releasing it back to the operating system, your app will find itself terminated in a hurry. On the other hand, a slow memory leak may not rear its head until your app's session is several hours or days old.
Profiling can help if you suspect a memory leak, but it's a good idea to profile your app anyway in order to determine whether it is just using too much memory in general. Not all memory problems are leaks, after all.
This said, what would a memory leak look like? Well, it would look like an ever-rising line in the profiler graph, as follows:
The time frame here is important; this is over a significant period of time, not just a couple of seconds. Due to the way the browser manages memory, there will always be some small period of time where you will see the graph continually rising. The catch is that, in this example...