welsonsun

Q: Preview App memory leak

The Preview app in El Capitan has serious memory leak problem. Open a 100MB pdf file, scroll for a while, it will easily consumes giga bytes of RAM! Once it used 8G!

MacBook Pro with Retina display, OS X El Capitan (10.11)

Posted on Oct 12, 2015 9:30 PM

Close

Q: Preview App memory leak

  • All replies
  • Helpful answers

first Previous Page 4 of 5 last Next
  • by dialabrain,

    dialabrain dialabrain Feb 19, 2016 3:37 AM in response to dialabrain
    Level 5 (6,211 points)
    Mac App Store
    Feb 19, 2016 3:37 AM in response to dialabrain

    A 329 page PDF opened in Preview. Taking 568.2MB

    Screen Shot 2016-02-19 at 6.28.59 AM.png

  • by dialabrain,

    dialabrain dialabrain Feb 19, 2016 3:34 AM in response to jmmun
    Level 5 (6,211 points)
    Mac App Store
    Feb 19, 2016 3:34 AM in response to jmmun

    jmmun wrote:

     

    "If it had a leak OSX would not be able to release that memory when needed"

    Yes, I did say that. By definition, that is what a memory leak would do. Not release memory back to the OS.

     

    I'll be nice.

  • by MRossi90,

    MRossi90 MRossi90 Feb 19, 2016 3:40 AM in response to dialabrain
    Level 1 (0 points)
    Feb 19, 2016 3:40 AM in response to dialabrain

    What happens to the memory usage if you scroll and zoom in and out for a while? And by how much does the memory decrease when you close the document (WITHOUT quitting Preview)?

  • by jmmun,

    jmmun jmmun Feb 19, 2016 3:53 AM in response to dialabrain
    Level 1 (0 points)
    Feb 19, 2016 3:53 AM in response to dialabrain

    But it isn't a problem from OSX, it is a problem form Preview, more exactly to the PDFkit.

     

    You aren't being nice, we are here trying to talk to Apple about a problem with our computers. We need our computers to work, running out of ram is a serius problem (I have a 16GB and open PDF's with Preview is a problem).

     

    <Edited by Host>

  • by MRossi90,

    MRossi90 MRossi90 Feb 19, 2016 3:46 AM in response to jmmun
    Level 1 (0 points)
    Feb 19, 2016 3:46 AM in response to jmmun

    Well, at least he/she's keeping the thread in the top position in the forum!

  • by dialabrain,

    dialabrain dialabrain Feb 19, 2016 3:46 AM in response to MRossi90
    Level 5 (6,211 points)
    Mac App Store
    Feb 19, 2016 3:46 AM in response to MRossi90

    As I said in a previous post, I can get Preview to use up to 4.6GB if I try. Same 329 page manual. And as I tried to explain multiple times and for the last time, When you scroll and zoom multiple times, OSX keeps all those images in memory until the memory is needed for something else.

     

    However, I mentioned Foxit Reader. It does not apparently keep previously viewed pages in memory and therefor uses a lot less memory.

     

    So if you have RAM issues with Preview, you should try it.

     

    I'm done 'splainin now.

  • by MRossi90,

    MRossi90 MRossi90 Feb 19, 2016 3:50 AM in response to dialabrain
    Level 1 (0 points)
    Feb 19, 2016 3:50 AM in response to dialabrain

    Since I paid 1600 € for my Mac and it's OS, and this includes Preview, I'd really like to be able to use it without running out of memory. Using Foxit reader is a workaround for a problem that Apple engineers need to solve.

    OSX keeps all those images in memory until the memory is needed for something else.

     

    This is false, because the memory is not freed when it is needed for something else. Hence the force quitting of other applications.

    I'm done 'spainin too. See ya.

  • by dialabrain,

    dialabrain dialabrain Feb 19, 2016 4:09 AM in response to MRossi90
    Level 5 (6,211 points)
    Mac App Store
    Feb 19, 2016 4:09 AM in response to MRossi90

    Same manual, same Preview, same El Capitan. This time on my 8GB Mid 2013 MacBook Air. Scrolled to page 173.

    Screen Shot 2016-02-19 at 7.03.23 AM.png

    Have fun.

  • by Luis Sequeira1,

    Luis Sequeira1 Luis Sequeira1 Feb 19, 2016 4:31 AM in response to MRossi90
    Level 6 (12,152 points)
    Mac OS X
    Feb 19, 2016 4:31 AM in response to MRossi90

    I believe that it is clear that there are both similarities and differences in people's experiences.

    The similarities: Preview uses a LOT of RAM - this is not a problem per se; but

    The differences: Preview releases it/does not release it as needed. This becomes a serious problem when the memory is not released.

     

    It is usually easier to pinpoint a problem if it occurs all the time, or for everyone.

     

    What I see in my mac: Preview can be seen to use 10GB or more, BUT most of it is listed as "Compressed" (meaning that it will in actuality use signficantly less than the number listed); I have 16GB, and I can be running Final Cut Pro X and Motion, and a dozen other applications without a hiccup even if Preview is listed as using 10GB. Each time I close a document in Preview the memory usage decreases; each time I scroll up and down it increases.

     

    Try as I might, I could not make either Preview or the system crash or quit other applications for lack of memory.

     

    So, whether or not there is a bug in Preview (or, as has been said, in PDFKit), the most significant question may be: what is different in machines where there are crashes and machines that work fine? Usually the answer boils down to other software.

  • by dialabrain,

    dialabrain dialabrain Feb 19, 2016 4:35 AM in response to Luis Sequeira1
    Level 5 (6,211 points)
    Mac App Store
    Feb 19, 2016 4:35 AM in response to Luis Sequeira1

    All I can say is, I have 6 different Macs (5 plugged in) and Preview has never caused a memory issue or a freeze etc. One problem might be third-party Apps that don't play nice with Preview. It's a conundrum.

  • by Luis Sequeira1,

    Luis Sequeira1 Luis Sequeira1 Feb 19, 2016 4:39 AM in response to dialabrain
    Level 6 (12,152 points)
    Mac OS X
    Feb 19, 2016 4:39 AM in response to dialabrain

    dialabrain wrote:

     

    All I can say is, I have 6 different Macs (5 plugged in) and Preview has never caused a memory issue or a freeze etc. One problem might be third-party Apps that don't play nice with Preview. It's a conundrum.

     

    That is what I suspect. A conundrum indeed.

  • by Luis Sequeira1,

    Luis Sequeira1 Luis Sequeira1 Feb 19, 2016 5:03 AM in response to Luis Sequeira1
    Level 6 (12,152 points)
    Mac OS X
    Feb 19, 2016 5:03 AM in response to Luis Sequeira1

    Here is an image of Activity Monitor.

    At first look it may seem crazy that Preview "is" using more memory than I have, but if you look closely you will see that:

     

    1) >12GB of those is "compressed"

    2) At the bottom right, ALL the compressed memory (not just that related to Preview) uses just 2.94GB

    So in actuality Preview is using much less physical RAM than it seems.

     

    A similar behavior occurs with TeXShop, which relies on PDFKit as well.

     

    Screenshot 2016-02-19 at 12.47.23.png

  • by dialabrain,

    dialabrain dialabrain Feb 19, 2016 5:14 AM in response to Luis Sequeira1
    Level 5 (6,211 points)
    Mac App Store
    Feb 19, 2016 5:14 AM in response to Luis Sequeira1

    Luis Sequeira1 wrote:

     

    That is what I suspect. A conundrum indeed.

    IMHO, the problem is most users don't understand OSX memory management. And if the do have a problem and Preview is open, They jump to the conclusion that Preview caused their problem because it looks like it's using an excessive amount of memory. Apple should remove Activity Monitor.

  • by MRossi90,

    MRossi90 MRossi90 Feb 19, 2016 6:25 AM in response to dialabrain
    Level 1 (0 points)
    Feb 19, 2016 6:25 AM in response to dialabrain

    dialabrain wrote:

     

    Luis Sequeira1 wrote:

     

    That is what I suspect. A conundrum indeed.

    IMHO, the problem is most users don't understand OSX memory management. And if the do have a problem and Preview is open, They jump to the conclusion that Preview caused their problem because it looks like it's using an excessive amount of memory. Apple should remove Activity Monitor.

    I know I shouldn't waste my time with you, but you know-it-all guys are really annoying me. So, I did this:

    1. Fresh restart of OSX, closed all non-OS applications (I forgot Dropbox, but I can do all of this again without it if you really want me to)
    2. Here is Activity Monitor after a fresh start
      Screen Shot 2016-02-19 at 13.59.01.png
    3. Opened a 929 KB PDF file in Preview. Here is a screenshot immediately after
      Screen Shot 2016-02-19 at 13.59.37.png
    4. I started zooming in and out and scrolling and I continued for some minutes. Here is a screenshot after a while.
      Screen Shot 2016-02-19 at 14.03.08.png
      Notice that the system has started to use the swap file.
    5. Two minute after, here is the dialog saying that the system has run out of memory. As you can notice, Finder, Activity Monitor and Preview are the only open applications.
      Screen Shot 2016-02-19 at 14.05.02.png
    6. As you can see Preview is using 13.80 GB of compressed memory. The situation comes back to normal when I force quit Preview. Here it is
      Screen Shot 2016-02-19 at 14.05.39.png

    I hope this clears any doubt that the point is not me not understanding OS X memory management, but that there is a serious problem with PDFKit memory management.

     

    Cheers

  • by dialabrain,

    dialabrain dialabrain Feb 19, 2016 6:28 AM in response to MRossi90
    Level 5 (6,211 points)
    Mac App Store
    Feb 19, 2016 6:28 AM in response to MRossi90

    I like your wallpaper.

first Previous Page 4 of 5 last Next