You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

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

Reply
75 replies

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>

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.

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.

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.

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.


User uploaded file

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. 😎

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
    User uploaded file
  3. Opened a 929 KB PDF file in Preview. Here is a screenshot immediately after
    User uploaded file
  4. I started zooming in and out and scrolling and I continued for some minutes. Here is a screenshot after a while.
    User uploaded file
    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.
    User uploaded file
  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
    User uploaded file

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

Preview App memory leak

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.