Some problems are as old as dirt. One such thing in programming is called "memory leak."
Every computer program has two things: data and instructions on what to do with that data. When I type the letters "d" "a" "t" and "a." I am giving the browser that data. What it does with it is display the characters.
The data must be stored some place. And that place is the memory. It is the "DRAM" chips sitting in your computer some place.
Traditional programming calls for manually allocating chunk of memory inside the program, using it, and then "freeing" it so that it can be reused.
All is well as long as the programmer follows the sequence of, allocate, use and free correctly. But exceptions get in the way. An error condition occurs for the example and the program exits from that part of the code before freeing the memory. Keep repeating the same function and the memory allocated to the program starts to grow and grow. We call this a memory leak.
Memory leak like an air leak in your tires can be small or large. The latter causes you to have a flat, leading eventually to severe slow down and even hanging of your system.
Such was almost the case this morning. I wake up and while using my laptop I hear the alarm bells of something not being right: the fan in my laptop is running like mad even though all I am doing is typing on the Forum. The immediate diagnostic tool in Windows is called the Windows Task Manager which I invoke by holding the control key down, then pressing shift and escape keys all at the same time. Up pops this display which in this case, I have sorted by Memory column by pressing that heading:
We see a nice sorted display with Adobe Photoshop right on top, using 3.18 Gigabytes of memory at this instant. That is not all that much in this day and age. I usually have a few images open in it like the above display that I highlighted in Green. What was not right was watching that column grow and grow. Just a few seconds later, this is what the output looks like:
We are now up to 3.27 gigabytes in just a few seconds! And the meter kept running as was the fan. Not only was the memory being used but the app doing something to cause it even though I was not doing a thing inside Photoshop.
I went in there and closed the images I had open. There were about five of them. Once I did that, the memory growth stopped and with it, the fan in my laptop shut off. Oh, peace returns!
Looking at Task Manager, I see that it is using 3.25 Gigabytes of memory. So it gave a bit back but kept all of the memory it had gobbled up due that leak!
Fortunately, that is not a problem. The operating system will steal that memory back from it if it needs it. Since that memory will likely not be used by Photoshop anyway (since it had lost it due to leakage), it won't be an issue. But I can fix it if I want by quitting out of Photoshop and restarting it. Doing so now shows memory consumption of 0.27 gigabytes!
Memory leakage is one of those cardinal sins for programmers. If ever found there will be a black mark next to your name. You are supposed to write code that doesn't do this. And the test organization there to find them through proper testing. But here we are, with folks at Adobe given us such poor programming.
What caused the problem? It is hard to say but I have a clue. I was in Adobe Lightroom and told it I wanted to edit one of my images in Photoshop. It proceeded to save my file in uncompressed .tif format and hand it to Photoshop. I did my edit and closed that file and went into Lightroom. That was a couple of days ago. Fast forward to now and I am editing those to screenshots above which have .png extension. To my surprise, Photoshop wanted to save them as .tif by default! Clearly there is some lingering bug in the back and forth between Lightroom and Photoshop. Adobe makes both pieces of software but clearly didn't test the scenario well enough.
So next time your computer runs slow or you hear the fan running and warm air coming out, pop up the task manager. There is a similar app for MacOS by the way. Sort by CPU and Memory and see what is going on. You may be able to find and fix the offending program which in my case includes such apps as Microsoft Word or Outlook!!!
Every computer program has two things: data and instructions on what to do with that data. When I type the letters "d" "a" "t" and "a." I am giving the browser that data. What it does with it is display the characters.
The data must be stored some place. And that place is the memory. It is the "DRAM" chips sitting in your computer some place.
Traditional programming calls for manually allocating chunk of memory inside the program, using it, and then "freeing" it so that it can be reused.
All is well as long as the programmer follows the sequence of, allocate, use and free correctly. But exceptions get in the way. An error condition occurs for the example and the program exits from that part of the code before freeing the memory. Keep repeating the same function and the memory allocated to the program starts to grow and grow. We call this a memory leak.
Memory leak like an air leak in your tires can be small or large. The latter causes you to have a flat, leading eventually to severe slow down and even hanging of your system.
Such was almost the case this morning. I wake up and while using my laptop I hear the alarm bells of something not being right: the fan in my laptop is running like mad even though all I am doing is typing on the Forum. The immediate diagnostic tool in Windows is called the Windows Task Manager which I invoke by holding the control key down, then pressing shift and escape keys all at the same time. Up pops this display which in this case, I have sorted by Memory column by pressing that heading:
We see a nice sorted display with Adobe Photoshop right on top, using 3.18 Gigabytes of memory at this instant. That is not all that much in this day and age. I usually have a few images open in it like the above display that I highlighted in Green. What was not right was watching that column grow and grow. Just a few seconds later, this is what the output looks like:
We are now up to 3.27 gigabytes in just a few seconds! And the meter kept running as was the fan. Not only was the memory being used but the app doing something to cause it even though I was not doing a thing inside Photoshop.
I went in there and closed the images I had open. There were about five of them. Once I did that, the memory growth stopped and with it, the fan in my laptop shut off. Oh, peace returns!
Looking at Task Manager, I see that it is using 3.25 Gigabytes of memory. So it gave a bit back but kept all of the memory it had gobbled up due that leak!
Fortunately, that is not a problem. The operating system will steal that memory back from it if it needs it. Since that memory will likely not be used by Photoshop anyway (since it had lost it due to leakage), it won't be an issue. But I can fix it if I want by quitting out of Photoshop and restarting it. Doing so now shows memory consumption of 0.27 gigabytes!
Memory leakage is one of those cardinal sins for programmers. If ever found there will be a black mark next to your name. You are supposed to write code that doesn't do this. And the test organization there to find them through proper testing. But here we are, with folks at Adobe given us such poor programming.
What caused the problem? It is hard to say but I have a clue. I was in Adobe Lightroom and told it I wanted to edit one of my images in Photoshop. It proceeded to save my file in uncompressed .tif format and hand it to Photoshop. I did my edit and closed that file and went into Lightroom. That was a couple of days ago. Fast forward to now and I am editing those to screenshots above which have .png extension. To my surprise, Photoshop wanted to save them as .tif by default! Clearly there is some lingering bug in the back and forth between Lightroom and Photoshop. Adobe makes both pieces of software but clearly didn't test the scenario well enough.
So next time your computer runs slow or you hear the fan running and warm air coming out, pop up the task manager. There is a similar app for MacOS by the way. Sort by CPU and Memory and see what is going on. You may be able to find and fix the offending program which in my case includes such apps as Microsoft Word or Outlook!!!